Have you ever wondered why the sky is blue? Or why sunsets exhibit such pretty colors? Well the answer is pretty simple, and of course involves astronomy!
The Sun emits what we perceive as white light. If you send a beam of white light through a prism, you will see that it breaks up into all the colors of the rainbow. Each color of light has a different wavelength and therefore a different energy.
Gas molecules in the atmosphere have the ability to absorb and/or scatter light. And based on the type of gas molecule, it likes to interact with only certain colors of light. The atmosphere is made mostly of nitrogen and oxygen. These two molecules tend to let all colors of light pass by unharmed, except for blue light. Blue light has just the right energy to be absorbed and scattered by the gas. Therefore we have lots of blue light bouncing around in the atmosphere, making the sky appear blue!
When you look along the horizon you're actually looking through more atmosphere than when you look straight up. When the sun rises or sets, the light initially has to pass through more atmosphere than usual. Because of this, red light has a harder time getting through the atmosphere and is often scattered along with the blue light, making the sky appear reddish purple. You can thank astronomy for those pretty views!