Thus, astronomers can identify what kinds of stuff are in stars from the lines they find in the star's spectrum. This type of study is called spectroscopy. The science of spectroscopy is quite sophisticated. ... The spectral line also can tell us about any magnetic field of the star.