Here's why:
* Continuous Spectrum: Stars are hot, dense bodies that emit radiation across a wide range of wavelengths, creating a continuous spectrum. This means that all wavelengths of light are present, resulting in a smooth, unbroken rainbow-like pattern.
* Absorption Lines: As the light from the star's core travels through the cooler, outer layers of the star's atmosphere, certain wavelengths of light are absorbed by the atoms in those layers. This creates dark lines (absorption lines) at specific wavelengths within the continuous spectrum.
The pattern of these absorption lines is unique to the chemical composition of each star, allowing astronomers to determine the star's temperature, composition, and even its motion.
While some stars might exhibit emission lines instead of absorption lines (like young, hot stars), most stars display this combination of a continuous spectrum with absorption lines.