magma when it reaches the earth's surface.