Theory of bulk resonance diffraction in THEED