Just before sunset, the light of the sun has to travel the longest distance through the atmosphere (the shortest is at midday when the sun is directly overhead). Of all the colours of light emitted by the sun, red has the longest wavelength and gets ‘scattered’ (or reflected away) the least. So it ends up looking reddish.
Comments