Experimental and theoretical studies of resonant X-ray scattering