Why is the sky blue? Why are sunsets red? The answer involves Rayleigh scattering. When light strikes small particles, it bounces off in a different direction in a process called scattering. Rayleigh scattering is the scattering that occurs when the particles are smaller than the wavelength of the light. Blue light has a wavelength of about 400 nanometers, and red light has a wavelength of about 700 nanometers. Other colors of light are in between. A nanometer is a billionth of a meter. So, for Rayleigh scattering of visible light the particles must be smaller than 400 to 700 nanometers. Scattering can occur off larger particles, but it will follow a different scattering law.
The Rayleigh scattering law, derived by Lord Rayleigh in 1871, applies to particles smaller than the wavelength of the light being scattered. It states that the percentage of light that will be scattered is inversely proportional to the fourth power of the wavelength. Small particles will scatter a much higher percentage of short wavelength light than long wavelength light. Because the mathematical relationship involves the fourth power of the wavelength even a small wavelength difference can mean a large difference in scattering efficiencies. For example, applying the Rayleigh law to the wavelengths of red and blue light given above shows that small particles will scatter blue light roughly 10 times more efficiently than red light.
What does all this have to do with blue skies and sunsets? The earth's atmosphere contains lots of particles. The dust particles scatter light but are often large enough that the Rayleigh scattering law does not apply. However the nitrogen and oxygen molecules in the earth's atmosphere are particles small enough that Rayleigh scattering applies. They scatter blue light about 10 times as much as red light. When the Sun is high overhead on a clear day, some of the blue light is scattered. Much of it is scattered more than once before eventually hitting our eyes, so we see blue light coming not directly from the sun but from all over the sky. The sky is then a pretty shade of Carolina blue. In the evening, when there is less blue light coming directly from the Sun it will appear redder than it really is. What about sunsets? When the sun is low in the sky, the light must travel through much more atmosphere to reach our eyes. Even more of the blue light is scattered, and the Sun appears even redder than when it is overhead. Hence, sunsets and sunrises are red.