The answer has nothing to do with the sun, but everything to do with the sky and our atmosphere.
Our atmosphere, as clear as it looks, is actually made up of trillions and trillions of grains of dust, pollen, droplets of water and ice crystals. These items can actually change the way light behaves. Molecules of water and ice act like prisms, bending and scattering a beam of white light into different colours.
Most of the water and ice particles scatter (deflect) the blue light from the sun, leaving more of the yellow light behind. When the sun is near the horizon — either at sunrise or sunset — the light that comes to our eyes must travel through more atmosphere than when the sun is directly overhead.
As a result of the atmospheric scattering of the blue light, the sun and surrounding sky often take on a reddish colour that is beautiful to behold.