8. (Shanghai · Senior High School 3) In the spatial quadrilateral $ABCD$, $AD \perp AB, BC \perp AB, AD, BC$ form a $60^{\circ}$ angle, $AD=BC=a, C_{1}, C_{2}, D_{1}, D_{2}$ are points on the extensions of $BC, AD$ respectively, and $CC_{1}=C_{1}C_{2}=DD_{1}=D_{1}D_{2}=a$. Also, the lengths of $CD, C_{1}D_{1}, C_{2}D_{2}$ form a geometric sequence. Find the length of $AB$.
Let $AB = x, CD = m, C_2D_2 = n$, then $C_1D_1 = \sqrt{mn}$. Draw $AE \perp BC$, then $\angle DAE = 60^\circ$ or $120^\circ$.
If $\angle DAE = 60^\circ$, then $DE = a$.
Since $AD \perp AB, AB \perp AE$. Hence $AB \perp$ plane $ADE$, thus $CE \perp$ plane $ADE$. Therefore, $CE \perp DE$, and $\triangle CDE$ is a right triangle. Hence, we have $m^2 = a^2 + x^2$. Similarly, we have
\[
\begin{array}{l}
(\sqrt{mn})^2 = (2a)^2 + x^2, \\
n^2 = (3a)^2 + x^2.
\end{array}
\]

From this, we get $(4a^2 + x^2)^2 = (a^2 + x^2)(9a^2 + x^2)$,
\[
2a^2x^2 = 7a^4.
\]

Solving this, we get $x = \frac{\sqrt{14}}{2}a$.
If $\angle DAE = 120^\circ$, then using a similar method, we get $AB = \sqrt{\sqrt{42}} - a$.
Therefore, $AB = \frac{\sqrt{14}}{2}a$ or $\frac{\sqrt{42}}{2}a$.