Spacecraft experimentation found mostly igneous rock on the Moon (rock formed by cooling lava) but some sedimentary. The sedimentary rock was probably formed by falling debris after meteoritic impacts. The igneous rock in the marina is mostly basalt, but the highlands are mostly anorthosites. Both types form from cooling lava but under different conditions and at different cooling rates.
Radioactive dating of rocks brought back by the Apollo astronauts yields an absolute age (the time since the rocks solidified) of the highlands as 3.9 to 3.8 billion years, with the final lava flow around 3 billion years ago.
The Moon has no overall magnetic field. According to the currently favored model of planetary magnetic fields (the dynamo model), this means either that the Moon probably has no molten core or that only a very small part of the core is molten. There is a weak magnetic field frozen into the rocks, however, or the rocks have a north pole and a south pole, so it's possible that the Moon once had a magnetic field surrounding it.