Magma is molten rock that is found beneath the surface of the Earth, and may also exist on other terrestrial planets. Besides molten rock, magma may also contain suspended crystals and gas bubbles. Magma often collects in a magma chamber inside a volcano. Magma is capable of intrusion into adjacent rocks, extrusion onto the surface as lava, and explosive ejection as tephra to form pyroclastic rock.
Magma is a complex high-temperature fluid substance. Temperatures of most magmas are in the range 700°C to 1300°C (or 1292°F to 2372°F), but very rare carbonatite melts may be as cool as 600°C, and komatiite melts may have been as hot as 1600°C. Most are silicate solutions.
Environments of magma formation and compositions are commonly correlated. Environments include subduction zones, continental rift zones, mid-oceanic ridges, and hotspots, some of which are interpreted as mantle plumes. Despite being found in such widespread locales, the bulk of the Earth's crust and mantle is not molten. Rather, most of the Earth takes the form of a rheid, a form of solid that can move or deform under pressure. Magma, as liquid, preferentially forms in high temperature, low pressure environments within several kilometers of the Earth's surface.
Magma compositions may evolve after formation by fractional crystallization, contamination, and magma mixing. By definition, all igneous rock is formed from magma.
While the study of magma has historically relied on observing magma in the form of lava outflows, magma was discovered in situ for the first time in 2008.