The lines in the diagram represent the direction of travel of the wave and represent that the waves reflect off atoms in different locations.
Generally, if some atom is at position $\vec R_1$ and for example a plane wave $e^{i\vec k \cdot \vec r}$ reflects off of the atom, the outgoing wave is proportional to: $$ \frac{1}{|\vec r - \vec R_1|}e^{ik|\vec r - \vec R_1|}e^{i\vec k\cdot \vec R_1} $$
If the same incident plane wave reflects off a different atom at a different location $\vec R_2$ the outgoing wave is proportional to: $$ \frac{1}{|\vec r - \vec R_2|}e^{ik|\vec r - \vec R_2|}e^{i\vec k \cdot \vec R_2} $$
There is a phase difference between the waves because the initial plane wave has to travel different distances to get to the different atoms.
In a solid the locations $\vec R_i$ are regularly distributed and cause diffraction patterns. However the expression for the total diffracted wave can be written down for any collection of scatterers at locations $\vec R_i$ as: $$ \sum_i \frac{1}{|\vec r - \vec R_i|}e^{ik|\vec r - \vec R_i|}e^{i\vec k \cdot \vec R_i}\;, $$ where the first factor is the outgoing spherical wave (from each scatterer) and the last factor is due to the incoming plane wave having to travel different distances to each scatterer.
We also use the approximation: $$ |\vec r - \vec R_i| \approx r - \frac{\vec r}{|r|}\cdot\vec R_i\;, $$ in the exponential of the outgoing spherical wave, which we will see is valid when the final observation location $r$ is very large compared to the distance between scatterers.
And we use the approximation: $$ |\vec r - \vec R_i| \approx r\;, $$ in the denominator of the outgoing spherical wave.
For the case of two scatterers we use the above approximation and find the total wave amplitude at the observation point $\vec r$ to be: $$ \frac{e^{ikr}}{r}\left( e^{-ik\hat r\cdot \vec R_1}e^{i\vec k \cdot \vec R_1} + e^{-ik\hat r\cdot \vec R_2}e^{i\vec k \cdot \vec R_2} \right) $$
And the total phase difference is: $$ (\vec k - k\hat r)\cdot(\vec R_1 - \vec R_2) = \frac{2\pi}{\lambda}2d\cos(\theta) $$