Here is something interesting to think about: When you look at the sky at night, it is black, with the stars and the moon forming points of light on that black background. So why is it that, during the day, the sky does not remain black with the sun acting as another point of light? Why does the daytime sky turn a bright blue and the stars disappear?

The first thing to recognize is that the sun is an extremely bright source of light -- much brighter than the moon. The second thing to recognize is that the atoms of nitrogen and oxygen in the atmosphere have an effect on the sunlight that passes through them.

There is a physical phenomenon called Rayleigh scattering that causes light to scatter when it passes through particles that have a diameter one-tenth that of the wavelength (color) of the light. Sunlight is made up of all different colors of light, but because of the elements in the atmosphere the color blue is scattered much more efficiently than the other colors.

So when you look at the sky on a clear day, you can see the sun as a bright disk. The blueness you see everywhere else is all of the atoms in the atmosphere scattering blue light toward you. (Because red light, yellow light, green light and the other colors aren't scattered nearly as well, you see the sky as blue.)

Here are some interesting links: