A coupled wave theory of scalar volume diffraction by two-dimensional transmission gratings is formulated in terms of the Fourier spectrum. The restrictions of existing theories that neglect Fresnel diffraction, spurious diffracted waves or higher order diffraction are avoided; gratings of general form are permitted. Its application to holographic gratings allows general beams during recording and replay. Comparison is made between existing theories and the discrete form of this generalized formulation. Numerical simulations have been made for many cases that cannot be satisfactorily treated by other methods. Calculations of real image fields are presented, including the foci of holographic lenses and the images of scattering objects.