CRASH4: X-rays radiative transfer