In this paper, we develop spatiotemporal coupled-mode theory to describe optical properties of guided-mode resonant gratings. We derive partial differential equations that describe both spatial and temporal evolution of the field inside the grating. These equations describe the coupling of two counter-propagating grating modes, revealing the structure's "dark" and "bright" resonances at normal incidence of light. Moreover, the proposed theory allows us to obtain a simple approximation of the transmission and reflection coefficients taking into account both light's frequency and angle of incidence. This approximation can be considered as the generalization of the Fano line-shape. The approximation is in good agreement with the rigorous computations based on the Fourier modal method. The results of the paper will be useful for design and analysis of guided-mode resonant filters and other photonic devices. (C) 2015 Optical Society of America