Specifically, sunlight travels thought the solar system in straight, invisible waves (unless something sends it off in a different direction) and consists of a mixture of all colors in the visible portion of the electromagnetic spectrum. Furthermore, each color in this spectrum is associated with a different wavelength: red and orange have the longest wavelengths--while blue, indigo, and violet have the shortest (i.e., 0.47 um for violet to 0.64 um for red). Thus, when sunlight first enters the Earth's atmosphere, air molecules are typically the first to scatter the colors in sunlight--one by one, beginning at the violet end of the spectrum.
Specifically, when the sun is high in the sky (and there is a relatively short pathway to the Earth), violet, indigo, blue, and a little green are scattered, producing a blue sky. However, when the sun is low in the sky (i.e., sunrise or sunset), its path through the atmosphere is longer and yellow, orange, and red colors are scattered near the ground. Thus, as a general rule, the farther light travels through the atmosphere, the redder it becomes. The longer trip means more and more light at the blue end of the spectrum is scattered. This leaves red, yellow, and orange light to reach our eyes or reflect off clouds. This notion is perhaps best illustrated by example: a beam of sunlight that at a given moment produces a red sunset over the Appalachians is at the same time contributing to the deep blue of a late afternoon sky over the Rockies.
'To myself I seem to have been only like a boy playing on the seashore, and diverting myself in now and then finding a smoother pebble or a prettier shell than ordinary, whilst the great ocean of truth lay all undiscovered before me.'