Light is electromagnetic radiation that travels in waves. What we perceive as white sunlight actually contains all colors of the visible spectrum. Each color corresponds to a different wavelength, ranging from red light at about 700 nanometers to violet light at about 400 nanometers. Understanding these wavelength differences is crucial to explaining why the sky appears blue.
When sunlight travels from space toward Earth, it encounters our planet's atmosphere. This atmosphere is composed primarily of nitrogen and oxygen molecules that are incredibly small, much smaller than the wavelengths of visible light. These tiny gas molecules are scattered throughout the atmospheric layers surrounding Earth, and they play a crucial role in determining how light behaves as it passes through.
Rayleigh scattering is the key mechanism that explains why the sky is blue. When light encounters particles much smaller than its wavelength, the amount of scattering depends on the inverse fourth power of the wavelength. This means that blue light, with its shorter wavelength of about 470 nanometers, scatters about five times more intensely than red light with its longer wavelength of 700 nanometers. As sunlight passes through the atmosphere, blue light gets scattered in all directions much more than red light.
If violet light scatters more than blue light, why don't we see a violet sky? The answer lies in three important factors. First, the sun produces less violet light compared to blue light in its spectrum. Second, human eyes are much less sensitive to violet wavelengths than to blue wavelengths. Third, some violet light gets absorbed by the upper atmosphere before it can reach our eyes. When we combine all these effects - solar output, eye sensitivity, and atmospheric absorption - blue light dominates what we actually perceive, giving us our familiar blue sky.
Now we can understand the complete picture of why the sky changes color throughout the day. During midday, when the sun is directly overhead, sunlight travels through the shortest path through our atmosphere. Most of the blue light gets scattered in all directions, creating our familiar blue sky, while red light passes through relatively undisturbed. However, during sunrise and sunset, sunlight must travel through much more atmosphere to reach us. This longer path means that most of the blue light gets scattered away before it reaches our eyes, leaving the longer wavelengths like red and orange to dominate what we see. This is why sunrises and sunsets appear red and orange, while the sky above appears blue during the day.