When We consider X-ray diffraction by a crystal, We account for the path difference between the rays reflected by the successive lattice planes. However, Light is scattered by the atoms on the lattice plane, Which travels in all the directions. But we consider interference between only these two parallel rays and check the constructive and destructive interference. I have tried to search from various sources, But I have never found a solution which considers all the rays and considers the superposition of all such waves and then determine the conditions for maxima and minima.
The shortest explanation in detail that I have seen is by Feynman.
The radically shortened version of Feynman's already brief explanation goes like so.
Yes, light scatters in all directions. The chance to observe a photon at a given location depends on the amplitude of the wave at any given location.
So an array of atoms, such as in some crystals, can act as a series of sources. Because each one is acting as a source that gets activated by the same photon, they act in phase modified by path length. The path to-and-from each atom tells you how much the phase of each photon changes between the source and the detector.
At some locations you get constructive interference because the path length to that point happens to be exactly (or nearly) an integral number of wavelengths different from the path to the neighboring atoms. At other locations or at other angles, it's not integral. So things tend to wash out.