Magma 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 or solidify underground to form an intrusion (e.g., an 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 Magma usage for energy production), and once in Hawaii. Most magmatic
Magma known processes by which magma changes: by crystallization within the crust or mantle to form a pluton, or by volcanic eruption to become lava or tephra. When magma cools it begins to form solid mineral phases. Some of these settle at the bottom of the magma chamber forming cumulates that might form mafic layered intrusions. Magma that cools slowly within a magma chamber usually ends up forming bodies of plutonic rocks such as gabbro, diorite and granite, depending upon the composition of the magma. Alternatively, if the magma is erupted it forms volcanic rocks such as basalt, andesite and rhyolite