This is the visible spectrum of the light from the sun. And if you have played with white light and prisms before, it might come as a huge surprise to you to know that the spectrum from the sun is actually not continuous.
Why is it not ? The dark patches in the above spectrum arise from gas at or above the
Sun’s surface absorbing sunlight emitted below.
Since there are different types of gases that compose the sun, there are numerous wavelengths of light that get absorbed by these gases.
How do we know which line corresponds to which ? Well, it’s because we have a periodic table, and we know the spectrum of all the elements in it:
And then it’s a matter of solving the jigsaw puzzle of fitting the spectrum with the tiles that you have. When we do so, we obtain the following composition of elements:
Source: Earth Blog
We can even take it one step further by finding the composition of other neighboring stars as well.
Source: Potsdam University
All of this information about the star can be captured from a simple spectrum. And this is why one of the most important tool that an astronomer has about an object is it’s spectrum.
Have a good one!