Pumice is a lava froth. This rock type is well known because of its lightness. It usually floats in water because of extreme vesiculation. It is usually light-colored and in most cases corresponds compositionally to rhyolite or dacite. There is a reason for that. These silica-rich rocks are highly polymerized (silicon tetrahedra are linked to each other to form a three-dimensional network which impedes the internal flow of lava). Basaltic lava, on the other hand, contains much less silica and flows more easily.
This rock is a trap to volcanic gases that tried to escape from magma but were unable to do it because they simply could not break out and formed many gas-filled vesicules instead. Trapped gases occupy much larger volume than they did when dissolved in magma. Hence, it is perhaps needless to say that it forms as a result of explosive volcanic eruptions.
Explosive volcanoes that produce this rock type are predominantly located at the continental margins above subduction zones (The Pacific Ring of Fire, for example). This environment is favorable for this type of volcanism because lava above subduction zones is rich in volatiles (gases expand when magma ascends) and it is also enriched in material incorporated from the continental crust (siliceous mahma is more viscous).
This piece of rock from Santorini was thrown out of a volcano approximately 3600 years ago during the Minoan eruption. The eruption was one of the most powerful in historic times, 30 cubic kilometers of rocks were ejected from the volcano1. The width of the specimen is 40 mm.
Phonolitic pumice from Tenerife. Width of sample is 6 cm.
A layer of pumice between darker layers of scoria in Tenerife. Pumice layer is a product of violent Plinian eruption farther away. Scoriaceous mafic dark-colored lapilli were ejected from nearby vents (Strombolian eruptions).
Pyroclastic rocks in Santorini. White is pumice. Larger black and brown volcanic rocks are andesite blocks.
Granadilla pumice in Tenerife is a lapillistone composed of phonolitic pumice.
Glassy coulée in the background and a hill made of frothy lapilli in the lower part of the picture. Tenerife.
Scoria (from Tenerife; on the left) and pumice (from Santorini) are both vesicular but pumice is usually much lighter (in color and weight) and contains more small holes.
References
1. Schmincke, Hans-Ulrich (2005). Volcanism. Springer.