A few years ago, Andrews and Brau (AB) presented the dispersion relation for a lamellar grating in two dimensions (2D) as a step in understanding coherent Smith-Purcell radiation. This involved solving Maxwell's equations both in the grooves and in the region above the grooves, where Floquet theory was used. The coupling with an electron beam was studied, and an expression for the gain as a function of current was derived. Their approach has been supported by 2D simulations using particle-in-cell (PIC) codes, and more recently by a demonstration experiment that used a wide grating. We present here the dispersion relation (in the absence of beam) of a grating in three dimensions, which turns out to be a relatively straightforward extension of the AB results. The predictions of this theory are compared with PIC simulations, and also with measurements of the transmission coefficient as a function of frequency. Extremely good agreement is observed.