Rayleigh x-ray scattering from many-electron atoms and ions