The sun's rays hit the Earth's atmosphere, where the light is scattered by nitrogen and oxygen molecules in the air. The blue wavelength of this light is affected more than the red and green wavelengths, causing the surrounding air to appear blue. At sunset, the sun's light passes farther through the atmosphere, deflecting and decreasing the blue in the air. Scattering by dust particles and pollution in the air causes the sunset to appear red.