Scattering of X-rays from crystal surfaces