are formed by magma from the molten interior of the Earth. If magma erupts on the surface as lava, it will form extrusive rock, e.g. basalt. These rocks are formed when magma solidifies.