Because Photons have energy and momentum:

When a photon encounters matter, it can interact with one of the electrons. The laws of conservation of energy and momentum apply, as in any elastic collision between two particles. This yields the change in wavelength of the scattered photon, known as the Compton Effect: