The interaction between an electron and a photon results in the electron being given part of the energy (making it recoil), and a photon of the remaining energy being emitted in a different direction from the original, so that the overall momentum of the system is conserved.
If the photon is of low but sufficient energy (in general a few eV to a few keV, corresponding to visible light through soft X-rays), it can eject an electron from its host atom entirely (a process known as the photoelectric effect), instead of undergoing Compton scattering.