New measurements of the solubility of Ar in basaltic, rhyolitic, orthoclasic, and albitic melts and glasses at Ar pressures of 250-10,000 bar and temperatures of 400-1300 degrees C are presented and combined with other solubility measurements for a wider range of melt compositions to parameterize the effects of pressure, temperature, and melt composition on Ar solubility. Argon solubility in melts and glasses is roughly linear with Ar pressure under these conditions. At near-liquidus temperatures, solubility in melts is approximately independent (within similar to 10%) of temperature, while some results below 600-700 degrees C show an increase in solubility with decreasing temperature, perhaps reflecting differences in the nature of Ar solubility in glasses and melts. There is also a positive, linear correlation between the ''ionic porosity'' of melt and the logarithm of Ar solubility. This correlation is better than previously noted correlations between inert gas solubility and melt density and volume, and provides a useful means of predicting how Ar solubility varies with melt composition. The solubilities of He, Ne, Kr, and Xe are also positively correlated with ionic porosity, but are increasingly sensitive to ionic porosity as the size of the gas atom increases, suggesting that with more efficient packing of the melt structure the availability of sites that can incorporate inert gas atoms decreases more rapidly for larger atoms than for smaller atoms. Comparison of inert gas solubilities with those of molecular CO2 and molecular H2O in rhyolitic melts shows that solubilities decrease in the order H2Omol much greater than He > Ne > Ar > CO2,(mol) approximate to Kr > Xe. The much higher solubility of molecular H2O compared to the other neutral gas species (and molecular CO2) suggests that it is not merely passively occupying interstitial ''holes'' in the melt structure as is thought to be the case for the rare gases (and likely for molecular CO2), but rather it is stabilized in the melt structure by chemical bonds (e.g., by hydrating cations or through hydrogen bonds).