The modal method is applied to the problem of conical diffraction on a rectangular slit metallic grating lying on an arbitrary multilayer medium. In the approximation of the surface impedance boundary condition on the grating walls, a single matrix equation is obtained, whose coefficients are expressed simply by the reflectivities on the different layers. A simple and comprehensive treatment is thus obtained for virtually any multilayer system. The method is illustrated for the case of a cavity formed by a planar metallic mirror and a grating, as well as the system formed by a doped layer with Drude susceptibility in a substrate below the grating. The method could be useful for the design of near- and far-infrared devices.