About 3.8 billion years ago, the water condensed into rain which filled the basins that are now our oceans. According to this theory, the ocean formed from the escape of water vapor and other gases from the molten rocks of the Earth to the atmosphere surrounding the cooling planet.