Volcanic rock (often shortened to volcanics in scientific contexts) is a rock formed from magma erupted from a volcano. In other words, it differs from other igneous rock by being of volcanic origin. Like all rock types, the concept of volcanic rock is artificial, and in nature volcanic rocks grade into hypabyssal and metamorphic rocks and constitute an important element of some sediments and sedimentary rocks. For these reasons, in geology, volcanics and shallow hypabyssal rocks are not always treated as distinct. In the context of Precambrian shield geology, the term volcanic rock is applied to what are strictly metavolcanic rocks.
Volcanic rocks are among the most common rock types on Earth's surface, particularly in the oceans. On land, they are very common at plate boundaries and in flood basalt provinces.
Setting and size 
|This section requires expansion. (May 2011)|
Volcanic rocks are usually fine-grained or aphanitic to glass in texture. They often contain clasts of other rocks and phenocrysts. Phenocrysts are crystals that are larger than the matrix and are identifiable with the unaided eye. Rhomb porphyry is an example with large rhomb shaped phenocrysts embedded in a very fine grained matrix.
Volcanic rocks often have a vesicular texture caused by voids left by volatiles escaping from the molten lava. Pumice is an example of explosive volcanic eruption. It is so vesicular that it floats in water.
Most modern petrologists classify igneous rocks, including volcanic rocks, by their chemistry when dealing with their origin. The fact that different mineralogies and textures may be developed from the same initial magmas has led petrologists to rely heavily on chemistry to look at a volcanic rock's origin.
The chemistry of volcanic rocks is dependent on two things: the initial composition of the primary magma and the subsequent differentiation. Differentiation of most volcanic rocks tends to increase the silica (SiO2) content, mainly by crystal fractionation.
The initial composition of most volcanic rocks is basaltic, albeit small differences in initial compositions may result in multiple differentiation series. The most common of these series are tholeiitic, calc-alkaline, and alkaline.
Most volcanic rocks share a number of common minerals. Differentiation of volcanic rocks tends to increase the silica (SiO2) content mainly by fractional crystallization. Thus, more evolved volcanic rocks tend to be richer in minerals with a higher amount if silica such as phyllo and tectosilicates including the feldspars, quartz polymorphs and muscovite. While still dominated by silicates, more primitive volcanic rocks have mineral assemblages with less silica, such as olivine and the pyroxenes. Bowen's reaction series correctly predicts the order of formation of the most common minerals in volcanic rocks.
Occasionally, a magma may pick up crystals that crystallized from another magma; these crystals are called xenocrysts. Diamonds found in kimberlites are rare but well-known xenocrysts; the kimberlites do not create the diamonds, but pick them up and transport them to the surface of the Earth.
Volcanic rocks are named according to both their chemical composition and texture. Basalt is a very common volcanic rock with low silica content. Rhyolite is a volcanic rock with high silica content. Rhyolite has silica content similar to that of granite while basalt is compositionally equal to gabbro. Intermediate volcanic rocks include andesite, dacite, trachyte, and latite.
Pyroclastic rocks are the product of explosive volcanism. They are often felsic (high in silica). Pyroclastic rocks are often the result of volcanic debris, such as ash, bombs and tephra, and other volcanic ejecta. Examples of pyroclastic rocks are tuff and ignimbrite.
Shallow intrusions, which possess structure similar to volcanic rather than plutonic rocks are also considered to be volcanic.
Composition of volcanic rocks 
The sub-family of rocks that form from volcanic lava are called igneous volcanic rocks (to differentiate them from igneous rocks that form from magma below the surface, called igneous plutonic rocks).
The lavas of different volcanoes, when cooled and hardened, differ much in their appearance and composition. If a rhyolite lava-stream cools quickly, it can quickly freeze into a black glassy substance called obsidian. When filled with bubbles of gas, the same lava may form the spongy appearing pumice. Allowed to cool slowly, it forms a light-colored, uniformly solid rock called rhyolite.
The lavas, having cooled rapidly in contact with the air or water, are mostly finely crystalline or have at least fine-grained ground-mass representing that part of the viscous semi-crystalline lava flow that was still liquid at the moment of eruption. At this time they were exposed only to atmospheric pressure, and the steam and other gases, which they contained in great quantity were free to escape; many important modifications arise from this, the most striking being the frequent presence of numerous steam cavities (vesicular structure) often drawn out to elongated shapes subsequently filled up with minerals by infiltration (amygdaloidal structure).
As crystallization was going on while the mass was still creeping forward under the surface of the Earth, the latest formed minerals (in the ground-mass) are commonly arranged in subparallel winding lines that follow the direction of movement (fluxion or fluidal structure)—and larger early minerals that previously crystallized may show the same arrangement. Most lavas fall considerably below their original temperatures before emitted. In their behavior, they present a close analogy to hot solutions of salts in water, which, when they approach the saturation temperature, first deposit a crop of large, well-formed crystals (labile stage) and subsequently precipitate clouds of smaller less perfect crystalline particles (metastable stage).
In igneous rocks the first generation of crystals generally forms before the lava has emerged to the surface, that is to say, during the ascent from the subterranean depths to the crater of the volcano. It has frequently been verified by observation that freshly emitted lavas contain large crystals borne along in a molten, liquid mass. The large, well-formed, early crystals (phenocrysts) are said to be porphyritic; the smaller crystals of the surrounding matrix or ground-mass belong to the post-effusion stage. More rarely lavas are completely fused at the moment of ejection; they may then cool to form a non-porphyritic, finely crystalline rock, or if more rapidly chilled may in large part be non-crystalline or glassy (vitreous rocks such as obsidian, tachylyte, pitchstone).
A common feature of glassy rocks is the presence of rounded bodies (spherulites), consisting of fine divergent fibres radiating from a center; they consist of imperfect crystals of feldspar, mixed with quartz or tridymite; similar bodies are often produced artificially in glasses that are allowed to cool slowly. Rarely these spherulites are hollow or consist of concentric shells with spaces between (lithophysae). Perlitic structure, also common in glasses, consists of the presence of concentric rounded cracks owing to contraction on cooling.
The phenocrysts or porphyritic minerals are not only larger than those of the ground-mass; as the matrix was still liquid when they formed they were free to take perfect crystalline shapes, without interference by the pressure of adjacent crystals. They seem to have grown rapidly, as they are often filled with enclosures of glassy or finely crystalline material like that of the ground-mass . Microscopic examination of the phenocrysts often reveals that they have had a complex history. Very frequently they show layers of different composition, indicated by variations in color or other optical properties; thus augite may be green in the center surrounded by various shades of brown; or they may be pale green centrally and darker green with strong pleochroism (aegirine) at the periphery.
In the feldspars the center is usually richer in calcium than the surrounding layers, and successive zones may often be noted, each less calcic than those within it. Phenocrysts of quartz (and of other minerals), instead of sharp, perfect crystalline faces, may show rounded corroded surfaces, with the points blunted and irregular tongue-like projections of the matrix into the substance of the crystal. It is clear that after the mineral had crystallized it was partly again dissolved or corroded at some period before the matrix solidified.
Corroded phenocrysts of biotite and hornblende are very common in some lavas; they are surrounded by black rims of magnetite mixed with pale green augite. The hornblende or biotite substance has proved unstable at a certain stage of consolidation, and has been replaced by a paramorph of augite and magnetite, which may partially or completely substitute for the original crystal but still retains its characteristic outlines.
See also 
- This article incorporates text from a publication now in the public domain: Chisholm, Hugh, ed. (1911). "Petrology". Encyclopædia Britannica (11th ed.). Cambridge University Press.