How do scientist use spectra to identify the elements in the suns outer layer?

Scientists are able to use an instrument known as a spectrograph to examine the sun's layers. By examining the lines in the sun's spectrum, they are able to determine the kind of gas causing this a layer or line. Every element has a unique set of lines that offer a unique solar fingerprint. Examining these fingerprints enable scientists to determine what the sun or any other star is made of.