Magma from the mantle or lower crust rises through its crust towards the surface. If magma reaches the surface, its behavior depends on the viscosity of the molten constituent rock. Viscous magma produces volcanoes characterised by explosive eruptions, while non-viscous magma produce volcanoes characterised by effusive eruptions pouring large amounts of lava onto the surface. In some cases, rising magma can cool and solidify without reaching the surface. Instead, the cooled and solidified igneous mass crystallises within the crust to form an igneous intrusion. As magma cools the chemicals in the crystals formed are effectively removed from the main mix of the magma, so the chemical content of the remaining magma evolves as it solidifies slowly. Fresh unevolved magma injections can remobilise more evolved magmas, allowing eruptions from more viscous magmas.
Volcanoes are places where magma reaches the earth's surface. The type of volcano depends on the location of the eruption and the consistency of the magma.
Intrusions
These are formed where magma pushes between existing rock, intrusions can be in the form of batholiths, dikes, sills and layered intrusions.
Earthquakes
Earthquakes are generally associated with plate tectonic activity, but some earthquakes are generated as a result of volcanic activity.
When magma cools it solidifies and forms rocks. The type of rock formed depends on the chemical composition of the magma and how rapidly it cools. Magma that reaches the surface to become lava cools rapidly, resulting in rocks with small crystals such as basalt. Some of this magma may cool extremely rapidly and will form volcanic glass such as obsidian. Magma trapped below ground in thin intrusions cools more slowly than exposed magma and produces rocks with medium-sized crystals. Magma that remains trapped in large quantities below ground cools most slowly resulting in rocks with larger crystals, such as granite and gabbro. Existing rocks that come into contact with magma may be melted and assimilated into the magma. Other rocks adjacent to the magma may be altered by contact metamorphism or metasomatism as they are affected by the heat and escaping or externally-circulating hydrothermal fluids.
Volcanism on other bodies
Volcanism is not confined only to Earth, but is thought to be found on any body having a solid crust and fluid mantle. Evidence of volcanism should still be found on any body that has had volcanism at some point in its history. Volcanoes have indeed been clearly observed on other bodies in the Solar System – on some, such as Mars, in the shape of mountains that are unmistakably old volcanoes, but on Io actual ongoing eruptions have been observed. It can be surmised that volcanism exists on planets and moons of this type in other planetary systems as well. In 2014, scientists found 70 lava flows which formed on the Moon in the last 100 million years.