A new approach for the scattering of electromagnetic (EM) waves from periodic dielectric rough surfaces is addressed. The method is an extension of the buried object approach (BOA), which is developed for rough surfaces of infinite extend, to the present problem. The BOA allows to model the original problem as the scattering of EM waves from cylindrical objects located in a two-half-space medium with planar interface. Then, the problem is reduced to the solution of a Fredholm integral equation of second kind through the periodic Green's function of two-half-space medium. The periodic Green's function of two-half-space medium is calculated via the Floquet mode expansion, whose numerical evaluation can be accelerated by using effective methods. The method can also be used to solve the scattering problems of rough surfaces of infinite extend and having a localized roughness. Numerical simulations show that the method yields effective and accurate results for surfaces of arbitrary variation.