X-ray diffraction from crystals and time-averaging To calculate the elastically scattered intensity of x-rays from crystals, one classically considers scattering from a free electron first and then one sums up the scattered em-fields of all electrons in an atom and eventually in the whole crystals, after which the time-averaged Poynting vector gives an expression for the scattered intensity. For an unpolarized beam with intensity $I_{0}$, the elastically scattered intensity from a free electron in spherical coordinates is given by (Thomson scattering)
$$\begin{split}I(R,\phi,2\theta)=&I_{0}\frac{r_{e}^{2}}{R^{2}}(1-\sin^{2}2\theta\left<\cos^{2}\phi\right>)\\
=&I_{0}\frac{r_{e}^{2}}{R^{2}}\frac{1+\cos^{2}2\theta}{2}\quad\quad\quad\quad\quad\quad\quad (1)
\end{split}
$$
with $\left<\cdot\right>$ the time-average. Now when expanding this to crystals one writes
$$I(R,\phi,2\theta)=I_{0}\frac{r_{e}^{2}}{R^{2}}\frac{1+\cos^{2}2\theta}{2}GG^{\ast}\left<FF^{\ast}\right>\quad\quad (2)$$
with $X^{\ast}$ the complex conjugate of $X$ and $G$ the Laue interference function (wich is zero almost everywhere except for the directions for which Bragg's law holds) and $F$ the structure factor (which depends on time because electrons move in an atom and atoms move in a crystal due to thermal motion). The point is that the time average of $F$ and $\cos^{2}\phi$ are considered separately! But why is this valid? Or in other words, how does (2) follow from (3)
$$I(R,\phi,2\theta)=I_{0}\frac{r_{e}^{2}}{R^{2}}GG^{\ast}\left<FF^{\ast}(1-\sin^{2}2\theta\cos^{2}\phi)\right>\quad\quad (3)$$
 A: Not my field, but I hate to see a well asked question like this go without an answer, so I'll take a crack at it.
Firstly, if it works in practice then you have an empirical justification. If it works, it works.
But lets try to see why. 
Classical justification
Without actually knowing the answer my first inclination is to ask who the period of x-rays compare to the time scale on which $F$ varies. 
If these timescales are very different then you can reasonable hold the slow one as fixed while you average over the fast one, and then average over the slow one in order to determine you experimental response.
Semi-classical justification
Structure functions describe a physics that is largely quantum mechanical in nature. If you don't measure which configuration you scattered off of individually then you should sum over them incoherently. At the same time we continue to treat the E&M classically, so it gets time averaged after the incoherent quantum sum has been taken.
A: The simplest way to say it is that the photon scattering phase is uncorrelated with the crystal nuclear position configuration. The photon comes in and comes out while the crystal is effectively frozen, and the next photon sees a crystal which is effectively the same as the first, until, eons later from the point of view of any photon x-ray process, the crystal has thermally changed. The thermal average is a slow (on x-ray time scale) average as the nuclei jiggle around randomly, and it can be done independently of any fast photon average.
Photon atom Hamitlonian
But this is not a good answer to the confusion you have. The real reason this is confusing is because the book is using an unjustified classical calculation method that happens to give the same answer as the correct quantum calculation. The directional intensity of scattering of a single x-ray photon happens to be derivable from a classical model, because the classical wave is produced from a lot of coherent photons superposed together.
When you are dealing with X-ray photons and atoms, you should use the photon-atom Hamiltonian, assuming the nuclei are classical and the electrons are quantum, and the electron Hamiltonian is nonrelativistic, but coupled to radiation. This is the electron Hamiltonian
$$ \sum_n {( p -eA(x))^2\over 2m} + \sum_i V(x_i) + \sum_{i\ne j} {e^2\over (x_i-x_j)}$$
The field Hamiltonian is proportional to
$$ \sum_\epsilon \int |k| a_\epsilon^\dagger(k) a_\epsilon(k) {d^3 k\over (2\pi)^3} $$
Which is just the sum over modes of the photon energy times the number of photons, and $\epsilon$ is the polarization. This is how you should calculate photon by photon scattering. But the result is equivalent to calculating classical reradiation by free electrons. This is not a coincidence, but it gives you the conceptually wrong picture of what is going on.
The ground state energy of the electron Hamiltonian (ignoring the photons) is the potential energy for the classical nuclei, which you then allow to move classically. The Hamiltonian is used to lowest order perturbations to see the transitions due to the photons in the electrons and to calculate the photon scattering.
You can't use this Hamiltonian to do higher order perturbation calculations (at least not in a reasonable way, without hokey cutoffs at the mass of the electron), because it doesn't allow renormalization. This is because it is nonrelativistic. The photons change the effective mass of the electrons in a relativistically invariant way, but the elecrons are invariant under Galilean transformations, so that if you have a cancellation between bare-mass and mass correction, it doesn't work if the electron is moving at a constant speed. This failure of renormalization means that you get infinities in the higher order calculations, so that this formalism fails to give higher order answers. You need a relativistic theory, or a consistent nonrelativistic truncation.
But this formalism works great to tree order, ignoring loops. The scattering of x-ray photons off the electrons should be calculated this way.
