Deep beneath the surface of the Earth nearly all magmas contain gas dissolved in the liquid, but the gas forms a separate vapor phase when pressure is decreased as magma rises toward the surface of the Earth. This is similar to carbonated beverages which are bottled at high pressure. The high pressure keeps the gas in solution in the liquid, but when pressure is decreased, like when you open the can or bottle, the gas comes out of solution and forms a separate gas phase that you see as bubbles. The amount of gas in a magma is also related to the chemical composition of the magma. Rhyolitic magmas usually have higher gas contents than basaltic magmas.
The types of magma are determined by chemical composition of the magma. There are three general types of magma: 1) Basaltic magma, which is found at divergent plate boundaries and hotspot; it is chemical composition is SiO2 45-55 wt%, high in Fe, Mg, Ca, low in K, Na. 2) Andesitic magma, which is explosive and is located at convergent plate boundaries; its chemical composition is SiO2 55-65 wt%, intermediate in Fe, Mg, Ca, Na, K. 3) Rhyolitic magma, which is found in hotspots in continental crust; its chemical composition is SiO2 65-75%, low in Fe, Mg, Ca, high in K, Na.
Temperature of Magmas
Temperature of magmas is difficult to measure due to the danger involved, but laboratory measurement and limited field observation indicate that the eruption temperature of various magmas is as follows: basaltic magma temperature ranges from 1000 to 1200o C; andesitic magma from 800 to 1000o C; rhyolitic magma from 650 to 800o C.