Because electrons have wave properties they can be diffracted by crystals.
Electrons will be diffracted when the angle of incidence, θ on a crystal plane satisfies the Bragg Equation:
nλ = 2 d sin θ
where λ is the wavelength of the electrons, d is the spacing of the crystal planes and n is an integer.
A simple way to derive the Bragg equation is as follows. The path difference between electrons scattered from adjacent crystal planes is 2d sin θ. For constructive interference between the two scattered beams the difference must be an integer multiple of electron wavelengths, nλ which gives the Bragg equation.