The two-dimensional acoustic wave equation for inviscid compressible boundary layer flows, i.e. the Pridmore-Brown equation with an exponential velocity profile for homentropic flows, is studied for the reflection and over-reflection of acoustic waves based on the exact solution in terms of the confluent Heun function. The reflection coefficient $R$ , which is the ratio of the amplitude of the reflected to that of the incoming acoustic wave, is determined as a function of the streamwise wavenumber $\alpha$ , the Mach number $M$ and the incident angle $\phi$ of the acoustic waves. Over-reflection refers to $R>1$ , i.e. the reflected wave has a larger amplitude than the incident wave. We prove that, in the supersonic context, energy is always transferred from the base flow to the reflected wave, i.e. $R<1$ does not exist. Meanwhile, this fact is intimately linked to the critical layer. We show that the presence of the critical layer leads to an optimal energy exchange from the base flow into the acoustic wave, i.e. the critical layer ensures $R>1$ . In our analysis, we observe a special phenomenon, resonant over-reflection, which is proven to be closely related to resonant frequencies $\omega _r$ of unstable modes of the temporal stability of the base flow. At resonant frequencies of the first unstable mode, the over-reflection coefficient exhibits an unusual peak in an extremely narrow frequency interval. The maximum values of these peaks are largely synchronized with the variation of the growth rate $\omega _i$ of the unstable modes. In addition, resonant over-reflection appears also at resonant frequencies of other higher unstable modes, but their peaks of the over-reflection coefficient are always smaller than that induced by the first unstable mode.