The use of reconfigurable intelligent surfaces (RISs) for optimization of propagation channels is one of the most promising and revolutionizing techniques for improving the efficiency of the next generation of communications systems. In this work, we combine the physical optics approximation and the theory of diffraction gratings to study the scattering properties of finite-size metasurfaces mounted on partially reflecting walls and illuminated by directive antennas. We consider both reflective and refractive metasurfaces designed to control both reflection and transmission of waves. We start the analysis under the assumption of uniform, plane-wave illumination, and then discuss non-uniform illuminations by directive antennas.