Today, the accepted theory of how the moon was created is that it is made up of debris that was thrown into space when a very large object collided with the Earth some 4.45 billion years ago. This theory is called the Giant Impact Hypothesis. According to this hypothesis, something the size of Mars crashed into the still-forming Earth, causing pieces of the earth's crust and mantle to break off. These pieces coalesced into one round mass, our moon, while the earth and the impactor merged and melted together. A previous hypothesis had suggested that the moon was a "wanderer" that was captured by Earth's gravity, but gravity isn't strong enough to make this likely. Moreover, there is a similarity of composition between the moon and the Earth's crust, which is better explained by the Giant Impact Hypothesis.
The moon has a core of solid (unmelted) magma, surrounded by a layer of molten magma. Early in the moon's formation, some 4.45 billion years ago, iron and magnesium silicates in the molten magma sank toward the core, while feldspar rose to form the anorthosite crust. Meteors and other objects falling on the moon created great craters and mountains. Many of the large craters eventually filled with lava from lunar volcanoes, which cooled to basalt; these are the mares, or "seas," of the moon. Since this volcanic period, the moon has been cooling, so that over time volcanic activity has lessened, and the main geological changes are caused by meteor impacts. The surface of the moon is covered with regolith, which is made of small rocks, and a powder of rock fragments and volcanic glass particles. The south pole of the moon may have some water in the form of ice, which was brought in on comets and asteroids that impacted the moon.
Most of our knowledge about the moon and its formation comes from rocks collected by Apollo astronauts, which were tested soon after being brought to Earth in the late 1960s and early 1970s. The rocks were tested again in 2004, when new methods for looking at certain trace isotopes were available. Among the new findings were clues that more of the moon's material came from Earth than previously believed -- about 80 percent -- and only 20 percent from the asteroid that impacted our planet
A collision between an earth still in it's early stages and a second planet around the size of mars