On the basis of the method of reduced Rayleigh equations we present a simple and reciprocal theory of the coherent and incoherent scattering of x-rays from one- and two-dimensional randomly rough surfaces, that appears to be free from the limitations of earlier theories of such scattering based on the Born and distorted-wave Born approximations. In our approach, the reduced Rayleigh equation for the scattering amplitude(s) is solved perturbatively, with the small parameter of the theory η(ω) = 1 - Ε(ω), where Ε(ω) is the dielectric function of the scattering medium. The magnitude of η(ω) for x-rays is in the range from 10-6 to 10-3, depending on the wavelength of the x-rays. The contributions to the mean differential reflection coefficient from the coherent and incoherent components of the scattered x-rays are calculated through terms of second order in η(ω). The resulting expressions are valid to all orders in the surface profile function. The results for the incoherent scattering display a Yoneda peak when the scattering angle equals the critical angle for total internal reflection from the vacuum-scattering medium interface for a fixed angle of incidence, and when the angle of incidence equals the critical angle for total internal reflection for a fixed scattering angle. The approach used here may also be useful in theoretical studies of the scattering of electromagnetic waves from randomly rough dielectric-dielectric interfaces, when the difference between the dielectric constants on the two sides of the interface is small.