text: There are three main factors that affect the dispersion of volatiles in magma: confining pressure, composition of magma, temperature of magma. Pressure and composition are the most important parameters. To understand how the magma behaves rising to the surface, the role of solubility within the magma must be known. An empirical law has been used for different magma-volatiles combination. For instance, for water in magma the equation is n=0.1078 P where n is the amount of dissolved gas as weight percentage (wt%), P is the pressure in megapascal (MPa) that acts on the magma. The value changes, for example for water in rhyolite n = 0.4111 P and for the carbon dioxide n = 0.0023 P. These simple equations work if there is only one volatile in a magma. However, in reality, the situation is not so simple because there are often multiple volatiles in a magma. It is a complex chemical interaction between different volatiles.
  Simplifying, the solubility of water in rhyolite and basalt is function of pressure and depth below the surface in absence of other volatiles. Both basalt and rhyolite lose water with decreasing pressure as the magma rises to the surface. The solubility of water is higher in rhyolite than in basaltic magma. Knowledge of the solubility allows the determination of the maximum amount of water that might be dissolved in relation with pressure. If the magma contains less water than the maximum possible amount, it is undersaturated in water. Usually insufficient water and carbon dioxide exist in the deep crust and mantle, so magma is often undersaturated in these conditions. Magma becomes saturated when it reaches the maximum amount of water that can be dissolved in it. If the magma continues to rise up to the surface and more water is dissolved, it becomes supersaturated. If more water is dissolved in magma, it can be ejected as bubbles or water vapor. This happens because pressure decreases in the process and velocity increases and the process has to balance also between decrease of solubility and pressure. Making a comparison with the solubility of carbon dioxide in magma, this is considerably less than water and it tends to exsolve at greater depth. In this case water and carbon dioxide are considered independent. What affects the behavior of the magmatic system is the depth at which carbon dioxide and water are released. Low solubility of carbon dioxide means that it starts to release bubbles before reaching the magma chamber. The magma is at this point already supersaturated. The magma enriched in carbon dioxide bubbles, rises up to the roof of the chamber and carbon dioxide tends to leak through cracks into the overlying caldera. Basically, during an eruption the magma loses more carbon dioxide than water, that in the chamber is already supersaturated. Overall, water is the main volatile during an eruption.