# Why do stars have absorption spectra?

Absorption spectra are a result of light of a certain wavelength exciting an atom from a lower energy level to a higher one and at the same time being absorbed. However, the atom should eventually go back down to its lower energy state, and at the same time emit a photon of same frequency it absorbed earlier. Overall, no changes to the star's spectrum should occur.

-

When the energy level drops and the photon is re-emitted, it is scattered or re-emitted in a random direction, so less of that frequency reaches your telescope/spectroscope. It is sort of analogous to the "why is the sky blue" question. What you are looking at is direct line photons(line of sight), so photons passing through the star's gaseous layers are depleted in this line of sight by the random scattering.

-
What do you mean "random direction"? Stars are spherically symmetric, the photons are already going in random directions. –  Itai Bar-Natan Feb 12 '11 at 2:49
@Itai ---photons heading from the star straight to your line of sight are absorbed by gas in their path. The re-emitted photons are rarely re-emitted directly in their former path, hence, they are scattered, so fewer of those original line of sight photons reach your CCD or spectrometer. –  Gordon Feb 12 '11 at 3:18
As Omega Centauri points out in his answer, the crucial extra ingredient is that the deeper layers of a star have higher temperatures than the outer layers. If a star were at a uniform temperature, then there would be no absorption lines: as many photons would be scattered into your line of sight as out of it. –  Ted Bunn Feb 12 '11 at 15:55

A similar explanation, is that the intensity at any given frequency is the optical depth weighted average of the plank (black body) function. As the light ray goes deeper (maybe comes from deeper down is more intuitive) for each delta in optical depth the local temperature determines the ratio of emission to absorption. In the center of an absorption line, the opacity is higher, and thus the depth in the photosphere for a given optical depth is less than it is outside of the line. Since in the photosphere, temperature decreases with height, the spectral lines reflect a lower emission temperature. A more intuitive, but less exact way to think of it, is to consider the beam of light to be formed at an optical depth of unity. In the center of an absortion line, that depth is much less, so the strength of the plank function is much lower (reflecting the lower temperature higher up in the stellar atmosphere).

For very very strong lines, you can get the opposite effect -emission lines, as the temperature in the stars chromosphere and corona increase with height, and the closer to the line center you are the higher the effective height of formation.

-

Stars have plenty of "cold" gas (atoms in their ground states). If you put some gas on the way from a light source to you, some frequencies will be less represented (dark absorption lines) than non resonance frequencies. Atoms for such frequencies are like a fog on the light way - they capture and diffuse the resonance frequencies to the whole solid angle $4\pi$. So you observe them as less represented than the neighboring non resonance frequencies in the continuous spectrum.

-