Coupled-mode approach and electron Bloch equations are combined to calculate the gain of free-electron lasers using Smith-Purecell effect in the gain quantum model. The possibility of increasing gain by changing the spatial frequency of the grating is studied.