Magma (from Ancient Greek μάγμα (mágma) 'thick unguent') is the molten or semi-molten natural material from which all igneous rocks are formed. Magma is found beneath the surface of the Earth, and evidence of magmatism has also been discovered on other terrestrial planets and some natural satellites. Besides molten rock, magma may also contain suspended crystals and gas bubbles.

Magma is produced by melting of the mantle or the crust in various tectonic settings, which on Earth include subduction zones, continental rift zones,mid-ocean ridges and hotspots. Mantle and crustal melts migrate upwards through the crust where they are thought to be stored in magma chambers or trans-crustal crystal-rich mush zones. During their storage in the crust, magma compositions may be modified by fractional crystallization, contamination with crustal melts, magma mixing, and degassing. Following their ascent through the crust, magmas may feed a volcano to be extruded as lava, or solidify underground to form an intrusion, such as a igneous dike or a sill.

While the study of magma has historically relied on observing magma in the form of lava flows, magma has been encountered in situ three times during geothermal drilling projects—twice in Iceland (see Use in energy production), and once in Hawaii.

More Info: en.m.wikipedia.org