Caption: The formation of an absorption line spectrum.
Features:
The lines are the atomic spectral lines and/or molecular spectral lines.
The spectral lines are charateristcs of the particular atoms and/or molecules that make up the gas.
The study of line spectra---which is called spectroscopy---is overwhelmingly the most important form of chemical analysis.
You do NOT need a sample of the material. You just need light from the material.
It could come from your lab bench or from across the observable universe.
The atoms and/or molecules (including ionized atoms and molecules) in the low-density stellar atmosphere above the photosphere are colder (i.e., less excited) than the photosphere. They will absorb the photospheric emission in their lines.
The photosphere produces a continuous spectrum that closely approximates a blackbody spectrum.
The photosphere is often called the surface of a star, but that is just convenient usage. Stars do NOT have sharp surfaces.
Above the photosphere is the stellar atmosphere.
star file: nasa_spectra_002.html.