Magma that surfaces through a volcanic eruption is called lava. Magma is molten or partly molten rock beneath Earth’s surface; once it is extruded onto the surface, geologists use the term lava.
The change in name reflects location, not an entirely different material. Magma can contain liquid rock, crystals, and dissolved gases such as water vapor and carbon dioxide. As it rises, pressure drops and the gases begin to form bubbles, helping drive some eruptions. Once exposed, lava flows, cools, and solidifies into volcanic rock.
Lava’s temperature and behavior depend on its composition. Basaltic lava is relatively fluid and can travel long distances, while silica-rich rhyolitic lava is much more viscous. A common mix-up is calling underground molten rock “lava”; the standard distinction is magma below the surface and lava above it. The solid rocks produced afterward may include basalt, andesite, rhyolite, obsidian, scoria, or pumice.