Optical properties of ridge gratings for long-range surface plasmon polaritons (LRSPPs) are analyzed theoretically in a two-dimensional configuration via the Lippmann-Schwinger integral equation method. LRSPPs being supported by a thin planar gold film embedded in dielectric are considered to be scattered by an array of equidistant gold ridges on each side of the film designed for in-plane Bragg scattering of LRSPPs at the wavelength ~1550 nm. Out-of-plane scattering (OUPS), LRSPP transmission, reflection, and absorption are investigated with respect to the wavelength, the height of the ridges, and the length of the grating. Particular attention is paid to the fraction of the LRSPP power lost due to the OUPS. We find an asymmetry in the OUPS spectra in the vicinity of the band gap and relate this asymmetry to that observed in the transmission spectra. It is found that in order to maximize a reflection peak it is preferable to use longer gratings with smaller ridges compared to gratings with larger ridges, because the former result in a smaller OUPS from the grating facets than the latter. The theoretical analysis and its conclusions are supported with experimental results on the LRSPP reflection and transmission by ridge gratings. For comparison, a few calculations are also presented for surface plasmon polariton (SPP) scattering by ridge gratings, a configuration which corresponds to the LRSPP case with a very thick film. We found that, in this case, it is less attractive to use long gratings due to higher propagation loss and stronger confinement of SPPs in comparison with LRSPPs.