out of an erupting volcano. Formation of Igneous Rocks When a volcano erupts, redhot material may flow out of it. The extremely hot material is melted rock, called magma. Magma flows like a liquid. When magma flows near or onto Earth's surface, it cools and hardens.