The way light reflects off air molecules has an effect on the way people see the sky as well as the ocean. When orbiting the Earth, satellites and astronauts see a blue globe due to some of these same properties. The sheer amount of water on Earth makes it appear blue in these instances, but there are other factors as well.
Scattering in the Atmosphere
The atmosphere is predominantly made of two gases, nitrogen and oxygen. These molecules absorb and scatter, or radiate, different kinds of light. Red, yellow and orange light have longer wavelengths that are not affected by as much by atmospheric gases, so they are not absorbed, but blue light is scattered and radiated, creating the blue sky you see every day. That blue light is not as visible from space, but plays a role in the blue color of the Earth. At night, the sunlight no longer is around to interact with the gases, so the sky become black.
The Earth has many oceans and seas, from the Arctic Ocean to the Southern Ocean. Although there is red-hot heat below the surface of the Earth, the top layer is dominated by water. The oceans cover about 71 percent of the Earth and are blue, while land makes up the other 29 percent and varies in color, from green to tan to white. This gives the Earth the appearance of a blue marble. If the planet consisted mainly of land masses, it would be appear to be a different color completely.
Although water covers a large percentage of the Earth, it is important to understand why the water is blue as well. As with the Earth's atmosphere, most of the colors of the light spectrum are absorbed by the water. The water radiates the blue in the spectrum, giving it its blue color. If another color were radiated, say red for instance, the Earth would look red from outer space, like Mars. The land masses of the Earth do not look blue due to this same principle.
The Earth only appears blue if you are looking at it from outer space on the side that is being lit by the sun. When you are orbiting the Earth, it will appear black when you orbit around a part of the Earth that is experiencing night. Because there is no sun to create the light, all of the Earth will appear somewhat dark. The stars will be more visible as well during this period. Land masses will appear somewhat dark blue, as there are artificial light sources that illuminate the sky on land.