What happens to magma when it reaches the surface of a volcano?
Magma is nothing but molten rocks that travel from the interior of a planet to its surface. When this magma reaches the surface of a volcano, it is known as lava. The magma may cause violent volcanic eruption (in which the lava is violently thrown upwards and ultimately outwards) or may simply pour out slowly. When the magma is thick, violent volcanic eruption may happen. Nonviscous magma, on the other hand, generally results in a nonviolent outpouring of magma onto the planet's surface. Violent eruptions may cause part of the volcano to be destroyed. A great example of this is Mount St. Helens in Washington, USA, which lost a major portion of the volcano during its 1980 eruption. Ultimately, the lava cools down and solidifies and forms new rocks and surface layers.
Hope this helps.