The phenomena that affects the colour of sunset and sunrise is known as scattering of light. Reflection of light from an object in all direction is called scattering of light. The colour of scattered light depends on the size of scattering particles. Very small particles scatter mainly blue light by particles while particles that are larger in size scatter light of longer wavelength like red light. If the size of the scattering particle is large enough, then the scattering light may even appear white.
Now how this phenomenon effect the colour of the sun at sunrise and sunset?
At sunrise and sunset the sun and the sky appears red. Light from the sun near the horizone passes through thick layer of air and covers larger distance in the atmosphere before reaching our eyes. Near the horizontal most of the blue light and shorter wavelengths are scattered away by the particles. Therefore the light that reaches our eyes is of longer wavelength, this gives rise to the reddish appearance.
At the noon the light from the sun overhead would travel relative Lee shorter distance so it appears white as only a little of the blue and violet colours are scattered.
If the earth had no atmosphere then sky would have look dark and black.