Here's why:
* Blackbody Radiation: Stars emit light across a spectrum of colors, just like any heated object. This is known as blackbody radiation. The peak wavelength of this radiation is directly related to the star's temperature.
* Wien's Displacement Law: This law states that the peak wavelength of the radiation emitted by a blackbody is inversely proportional to its temperature. In other words, hotter objects emit light at shorter wavelengths.
* Color and Wavelength: Blue light has a shorter wavelength than red light.
* Hot Stars, Blue Light: Therefore, the hottest stars emit light with a peak wavelength in the blue region of the visible spectrum, making them appear blue to our eyes.
It's important to note that even though the hottest stars appear blue, they still emit light across the entire spectrum. We just perceive the blue wavelengths most prominently.