Volcanic rocks are those that form from compacted volcanic ash (tephra) or from cooled volcanic lava. Tuff, a light weight, porous rock, forms from layers of tephra that are subjected to heat and compression over millions of years.
Lava rocks are grouped into those that form from mafic magma (rich in iron and magnesium) or from felsic magma (rich in silica). Basalt, which has a silica content near 50%, is the primary mafic magma rock while andesite, dacite and rhyolite have a silica composition of 60%, 65% and 70%, respectively. The higher the silica content, the more viscous the lava; basalt generally forms extensive surface flows or shield volcanoes above volcanic hotspots or mid oceanic ridges while the felsic magmas, most common along subduction zones, produce more explosive stratovolcanoes. Pumice is a porous, spongiform rock that forms during stratovolcano eruptions when the felsic magma contains a large amount of water and gas.
Unlike granite, which cools slowly within the Earth's crust and is thus rich in crystals, the extruded felsic magmas cool rapidly and possess smaller and fewer crystals; the higher the silica content of the magma, the more finely grained the volcanic rock and the less its crystalline structure. Obsidian (rhyolite devoid of crystals) is essentially volcanic glass.