Spectroscopy uses a common principle of light, the fact that white light can be broken into different and distinct colors by shining it through a prism, creating a spectrum. A spectrum is nothing more than a representation of light at different frequencies. Our Sun breaks light into the familiar colors of the rainbow. But what does a spectrum tell us about such things as the chemical composition or the temperature of our Sun and other stars?
The answer lies in another aspect of how the spectrum is affected by different gases. An absorption spectrum, also called a black line spectrum exposes black lines amid the colors. These black lines coincide with the absorption of light of particular wave lengths by gases. By examining the black lines on the spectrum scientists can tell what elements are affecting the spectrum and hence what elements are contained in the star. And by adding Wien's law, which is a formula that uses the wavelength of a star to plot its temperature, scientists can figure out quite a lot about objects millions and millions of miles away.
'The important thing is not to stop questioning. Curiosity has its own reason for existing. Never lose a holy curiosity.'