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}{r}e^{ikr}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}{r}e^{ikr}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: $$ \frac{1}{r}e^{ikr}\sum_i e^{\vec k \cdot \vec R_i}\;, $$ where the first factor is just the outgoing spherical wave and the second is the part that leads to diffraction in a solid.
For the case of two scatterers the total wave is $$ \frac{1}{r}e^{ikr}(e^{i\vec k \cdot R_1}+e^{i\vec k \cdot R_2})\;, $$ and the phase difference is: $$ \vec k \cdot (\vec R_1 - \vec R_2) = \frac{2\pi}{\lambda}\cos(\phi)d\;, $$ where $\phi$ is the angle between the wave vector and the different in positions of the atoms and, $\cos(\phi) = \sin(\theta)$ in your notation.