Here's how it works:
* Sunlight is made up of all colors of the rainbow.
* Blue light has a shorter wavelength than red light.
* As sunlight travels through the atmosphere, it collides with air molecules. These collisions cause the light to scatter in all directions.
* Blue light scatters more easily than red light. This is why the sky appears blue during the day – blue light is scattered all around us.
* At sunrise and sunset, the sunlight has to travel through a greater distance of the atmosphere. This means more blue light is scattered away, leaving the longer wavelengths of red and orange light to reach our eyes.
* The clouds themselves also reflect and scatter the light, enhancing the orange and red hues.
In short: The orange color at sunset and sunrise is the result of the red and orange wavelengths of sunlight reaching our eyes after the shorter wavelengths of blue light have been scattered away by the atmosphere.