Absorption Spectra: When light passes through a gas, atoms and molecules in the gas absorb certain colors, or wavelengths, of that light. The result is an absorption spectrum: a rainbow with dark absorption lines.
Emission Spectra: The same gas can glow, giving off very specific colors to form an emission spectrum with bright lines known as emission lines.
Every element has a unique set of absorption and emission lines. The pattern of lines is known as a spectral signature. The absorption and emission spectra of each element are inverses of each other: The wavelengths of a particular element’s absorption lines are the same as the wavelengths of its emission lines. Astronomers can compare the spectrum of a celestial object or material with the spectra of known elements and molecules to figure out what the object or material is made of.