We have calculated the thermodynamic potential of a coal bed (CB) modeled by a porous solid matrix containing a gas. Explicit dependence of the CB elastic energy on the gas pressure and the elastic moduli and porosity of the coal is found. By minimizing the thermodynamic potential with respect to the gas pressure distribution in a CB, it is possible to determine regions of the CB where the gas pressure is increased and to evaluate the relative pressure growth in these regions caused by increasing external load on the CB. The results of such analysis can provide a basis for predicting the risk of gas outburst in local regions of the CB.