The scattering of light by molecules in the atmosphere creates a blue sky.
Reflecting on the clear blue sky, you may be wondering what produces such a beautiful color. The sky is not randomly blue; its color is not an accident of nature. There is a real scientific phenomenon behind the color of the sky. The sky is blue due to a process called Rayleigh scattering. This process involves the scattering of light from molecules in the atmosphere.
When light moves through the atmosphere, most of its wavelengths can just pass through it. This is particularly true for its longer wavelengths. However, shorter wavelengths are less able to get through and are instead absorbed by gas molecules in the atmosphere. It is important to understand that gas molecules absorb all colors of light; some are simply more easily absorbed than others. The sky is blue because blue light is more easily absorbed, while other wavelengths pass through easily.
To understand why the sky is blue, you need to consider what happens when gas molecules in the atmosphere absorb blue light. When blue light is absorbed, it spreads out in many directions, radiating across the sky. Since it stretches everywhere, the sky is blue no matter where you are and where you choose to look. Sunlight consists of a full range of colors. However, the sky is blue because the efficiency with which blue light is scattered allows it to dominate what you see when you look up.
If you pay attention to the color near the horizon, you will notice that the color appears paler than the sky above you. This is because light, when it is farther away, has to pass through more air before it gets closer to you. Some of that far blue light is scattered in other directions and less reaches your line of sight. As such, even though you see the blue sky near the horizon, it looks pale or white.
Although the sky is blue from his position on the ground, it actually looks black from space or from the moon. Since there is no atmosphere in space, sunlight is not scattered and colored light does not reach your eyes. Without our atmosphere, we would look up to see a black sky. Even a slightly thinner atmosphere would change our sky, making it appear a lighter blue.