“Why is the sky blue?” The question is often asked rhetorically, usually in response to some other question with no meaningful answer. The reason for the sky’s color is no mystery for the ages, though. In fact, there is a very simple explanation for it.
Sunlight, although appearing yellow to our eyes, is actually comprised of all of the colors of the rainbow. Each of these colors has its own wavelength. Most of them pass through our atmosphere without interruption, but the blue color, because of its short wavelength, is absorbed by tiny gas molecules and dust particles that hang in our atmosphere. These particles then reflect the blue light, bouncing it off of one another until it is all you can see. This process is called “Rayleigh scattering.”
As the light continues to pass through these particles, it becomes more diffused, which is why the sky looks paler near the horizon than directly overhead. Rayleigh scattering is also the reason that the Sun appears yellow on Earth. In space, the Sun looks white. Because the blue hues from its light become “caught” in our atmosphere, though, only the “warmer,” higher frequency colors reach our eyes.
As the Sun sets, its light must travel through more of our atmosphere to reach us. This causes the slightly higher frequency green light to be lost, as well, making the Sun appear red, instead of yellow.
Rayleigh scattering is what keeps us from seeing the stars when the Sun is up. Once the Sun has set completely, there is no light for our atmosphere to reflect, and the sky appears jet-black. High above our atmosphere, where no dust particles exist, the sky always appears black, and you can see the Sun and the stars at the same time.