Tyndall effect
The Tyndall effect, also commonly known as Rayleigh scattering, first came under the observation of the scientist John Tyndall in 1859, the University of California at Riverside states. He discovered that when white light passes through an area containing suspended particles, even microscopic or atomic particles, blue wavelengths of light bounce off of these particles and scatter. This scattering effect, when seen from the normally sharp angle of our position relative to the sun, creates a blue sky.
Atmospheric Density
When the sun is setting, it is at its furthest distance from your position. Rather than a sharp angle, the sun is almost in a flat, 180-degree angle from you. At this point, the sun's light has to pass through the maximum amount of atmosphere to reach your position. Because of the Tyndall effect, most of the blue light has scattered away by the time it reaches you, leaving the yellow, orange and red wavelengths of light, according to the University of Texas.
Yellow Sunsets
When the sky is clear and relatively free of particles, a sunset will be yellow, the University of California at Riverside reports. These yellow sunsets occur because blue light hasn't entirely scattered from the spectrum of light reaching you. Enough blue light bounces away to give the sunset a different color, but the remaining blue light mixes with the orange, yellow and red wavelengths to create a balanced yellowish sunset.
Red Sunsets
Deep red sunsets occur when lots of particles hang suspended in the atmosphere, according to Georgia State University. These particles may come from salt from the oceans, car fumes and other pollutants or even volcanic ash. Whenever a sky has a large amount of particles in the sky, the blue wavelengths of light have a much greater chance of striking one and scattering. As more light scatters, it leaves only the red, yellow and orange colors, making the sunset appear a much deeper red as a result.