6. The dihedral angle $\alpha-A B-\beta$ is $60^{\circ}, P \in \alpha, Q \in \beta, P, Q$ are not on $A B$, the angle between $P Q$ and $A B$ is $45^{\circ}$, and $P Q=$ $7 \sqrt{2}, Q$ is 3 units away from $A B$. Then the distance from $P$ to $A B$ is ( ).
(A) 5
(B) $\sqrt{37}$
(C) 8
(D) $\sqrt{79}$
6. As shown in the figure, construct $Q T$
$\perp A B$ at $T, Q R / /$ $A B, P R \perp Q R$ at $R$, $R S \perp A B$ at $S$, and connect $P S$. Then $P S \perp A S$.
$$
\begin{array}{l}
\therefore \angle P S R=60^{\circ} . \\
\text { Also } \angle P Q R=45^{\circ}, P Q=7 \sqrt{2}, \\
\therefore P R=\frac{\sqrt{2}}{2} P Q=7 .
\end{array}
$$

By the cosine rule,
$$
\begin{array}{l}
P R^{2}=P S^{2}+S R^{2}-2 P S \cdot S R \cos \angle P S R . \\
\text { Also } \quad S R=Q T=3, \\
\therefore 49=P S+9-3 P S .
\end{array}
$$
$$
\text { That is } P S^{2}-3 P S-40=0 \text {. }
$$

Solving it and discarding the negative root, we get $P S=8$. Therefore, the answer is $\mathrm{C}$.