I learned this in 8th grade science class...and forgot probably a week later. It has something to do with the speed at which the different frequencies in the light spectrum travel. The longer low frequency waves (red, yellow, and orange) get through the atmosphere more easily and are not as disrupted by the atmosphere. The violet and blue waves get scattered around all willy-nilly due to interference in the air. So, no matter where you look, some of the blue/violet waves reach your eyes. When the sun sets, only the oranges and reds are able to reach you because the waves have to travel farther. During the trip, the blues and violets are getting scattered around all crazy-style.