What I am actually after is to answer more scientifically the children's question: "What happens if I throw something in the Sun?" and my answer was always "It burns." but I am now wondering about the "How does it burn?"
It doesn't burn. What happens when an object such as an asteroid or comet impacts the Sun is in a sense the opposite of burning. The 5578 kelvins (5505 °C) temperature of the surface of the Sun is so high that it causes any chemical compound to undergo thermal decomposition. For example, a water molecule decomposes into two hydrogen and one oxygen atoms. No chemical compound can withstand such high temperatures.
So it's not burning that causes the spectral lines. Those spectral lines are dark areas in what otherwise appears to be close to black body radiation from an object at 5778 kelvins.
What causes them to occur is that elements absorb radiation at specific frequencies. This absorption of a photon raises an electron from one orbital state to another. The electron will eventually relax to its lower energy state, resulting in a photon of the same frequency being emitted, but in a random direction. The photons emitted toward the Sun -- we don't see them. What we see is holes in the spectrum at those absorption frequencies.