This paper extends the theory of the diffraction of sound on 1D corrugated surfaces to 2D corrugated surfaces. Such surfaces, that are egg crate shaped, diffract incoming sound into all polar directions, which is fundamentally different from 1D corrugated surfaces. A theoretical justification is given for extending the classical grating equation to the case of incident inhomogeneous waves, for 1D corrugated surfaces as well as for 2D corrugated surfaces. Even though the present paper presents a theory which is valid for all angles of incidence, special attention is given to the particular case of the stimulation of surface waves by normal incident sound. The most interesting conclusion is that, depending on the frequency and the incident inhomogeneity, Scholte-Stoneley waves and leaky Rayleigh waves can be generated in different directions. This effect might be of particular interest in the development of surface acoustic wave devices and the basic idea of this steering effect can be of importance for planar actuators.