When magma erupts at the surface, as lava, it can form different types of volcanoes depending on the viscosity, or stickiness, of the magma, the amount of gas in the magma, the composition of the magma and the way in which the magma reached the surface.