Within the framework of the acoustic approximation a solution of the plane nonstationary problem of impact on a fluid boundary is found. The fluid occupies the lower half-plane and consists of two layers with given speeds of sound and densities. The upper layer has a constant depth and is bounded above by a plate with a given normal velocity. The solution is constructed using the Fourier and Laplace integral transforms. Numerical calculations are performed for piston impact across a rigid screen and the impact of a jet with an aerated head on a rigid wall. It is shown that the presence of an interlayer with reduced speed of sound and/or density considerably changes the evolution of the hydrodynamic pressure distribution over the impacting surface: the absolute pressure maximum decreases but pressures of significant amplitude are maintained for a longer time than for a homogeneous fluid.