Answer:
The black lines in the Sun’s spectrum are caused by gases on, or above, the Sun’s surface that absorb some of the emitted light. Every gas (such as helium, hydrogen, oxygen, and so on) has a very specific set of frequencies that it absorbs.
Hope this helps!