We use a spectrometer to help us determine what stars and planets are made of by passing a light through various chemical elements, different spectral patterns are created. By matching those patterns up to patterns generated in a laboratory environment we can tell what the composition of a distant star or planet is.