The distribution of perturbations of pressure and velocity in a rectangular resonator is considered. A resonator contains a gas where thermodynamic processes take place, such as exothermic chemical reaction or excitation of vibrational degrees of a molecule’s freedom. These processes make the gas acoustically active under some conditions. We conclude that the incident and reflected compounds of a sound beam do not interact in the leading order in the case of the periodic sound with zero mean pressure including waveforms with discontinuities. The acoustic field before and after forming of discontinuities is described. The acoustic heating or cooling in a resonator is discussed.