It is due to scattering of light. At noon, the sun is at the nearest point to earth. Hence all the colors get scattered almost equally and this you see white light. During sunrise and sunset, the sun is at the farthest position. Here blue light gets scattered off and the red light, due to its larger wavelength, can travel a longer distance and hence reach our eyes. This we see the sun red.