X-ray-photon scattering by an excited atom