The motion of a perfect gas in a closed geometry is studied when it experiences large, transient, spatially non-uniform volumetric heating caused by the passage of energetic particles or intense light through the gas. The spatial non-uniformity of the heating results from the fact that the energy deposition in the gas is characterized by a range, a lengthscale which is inversely proportional to the local gas density. The equations of motion of the gas are acoustically filtered and then specialized to a one-dimensional problem. When written in Lagrangian form, the equations are reduced to a system of ordinary differential equations. Because of the special form of the one-dimensional range-dependent volumetric heating source term, this system can be solved analytically. Limitations on the applicability of this approximate analytical solution are discussed. Numerical simulations of specific cases for which the solution is valid are in agreement with the solution.