Sunlight is composed of all the colors of the visible spectrum.
Blue light is the component part of the visible spectrum that is strongly scattered by the earth's atmosphere at sunset, therefore sunlight tends to lack blue when the sun is near the horizon. Dispersion is the splitting of whitelight into its component parts. The red end of the visible spectrum shows the least amount of dispersion since it is refracted the least. At sunset, most of the orange and yellow light is absorbed by the earth's atmosphere, while the blue and violet light is scattered. Once the red light portion of the spectrum has already set below the horizon, all that is left is the green, which is occasionally seen as a short intense flash.