Spectrum of the Sun
If you take the light of our sun and separate it into its distinct components by running it through a prism or a diffraction grating, this is what you will see. The dark lines at specific wavelengths are called Fraunhofer lines after an 18th century German physicist and expert at making optical glass, who was the first person to record their presence using prisms he personally crafted.
Inside the sun, a full spectrum of light is generated, containing all of the available wavelengths and peaking in intensity at a wavelength of about 500 nanometers – at the blue end of the visible light spectrum. As the light leaves the sun however, it hits various atoms in the outer layers of the star that absorb some of the light, converting it back into heat and radiating it away at different wavelengths. The absorbances are quantized, meaning that they occur at specific wavelengths for each element. The wavelength is set by the electron cloud around each atom; if light is absorbed, it must have the energy that is required for the electron to jump from one state to another, and wavelengths that do not meet this criterion pass right through to hunt for another atom or head out into space.
Scientists have used these absorbances to estimate the abundance of various elements in the sun, although there are a few lines whose origin is not fully known because some elements have an absorbance at a similar wavelength to other elements.
-JBB
Image source: https://apod.nasa.gov/apod/random_apod.html
Reference: https://ui.adsabs.harvard.edu/abs/1995ApJS..100..473K/abstract