A stochastic theory is developed to describe the influence of glass formation history on the equation of state of polymer glasses and on the glass transition temperature. The theory is based on the assumption of a spatial distribution of free volume and hence mobility in the polymer system. The free volume is identified with the order parameter h in the Holey Huggins theory. The response of the system to a change in pressure and/or temperature is formed by a change of the actual free volume distribution to the new equilibrium. All requisite parameters but one can be obtained from independent experiments on the equilibrium polymer melt. The remaining parameter is presently determined from a nonequilibrium relaxation experiment. For poly(vinyl acetate) the calculated cooling rate and pressure dependence of the glass transition temperature and the calculated dependence of the equation of state of the polymer glass on formation pressure are compared to experimental data. In general, good agreement is obtained.