Spectral Lines

Hot things like stars tend to glow, and this makes light in all the different colours of the spectrum.

However, atoms can emit (make) or absorb (destroy) light of very specific colours. When the atoms in a gas are hotter than the incoming light, they emit light, and when they are colder, they absorb it.

Different atoms make or absorb different sets of colours. This means that astronomers can tell what atoms a star is made of by looking at the different colours that have been made or absorbed by the atoms.