The spectrum of a star shows absorption lines. Hypothetically, the continuous part of this spectrum can be approximated with that of a black body with a temperature equal to that of the surface of the star, even though a star is not a perfect emitter and does not have a well defined physical surface. The Sun emits in the yellow region of the optical band at the maximum of intensity, therefore its superficial temperature was set at 5,780 degrees Kelvin. As already said, each chemical element emits and absorbs certain wavelengths. A chemical element, if present in the outer layers of a star, produces an absorption line, that is it absorbs that wavelength from the light that comes from the star, leaving a dark line in its spectrum.
Some spectral lines are very important in astrophysics.
Among these, the lines of hydrogen, in particular that called H alpha, with a wavelength of 6,563 Angstrom . Therefore, they show in their spectra the lines of ionized helium. These are relatively rare stars. They are more common than the class O, but still quite rare. The lines of hydrogen dominate their spectra.