8. $2 \sqrt{2}$ Draw $a^{\prime} / / a$ through point $B$, then draw $P Q \perp a^{\prime}$ at $Q, Q H \perp b$ at $H$, connect $P H$. By the theorem of three perpendiculars, we know that $P H \perp b$, so the length of $P H$ is what we are looking for,
$$
\begin{array}{l}
\text { and } \angle Q B H=30^{\circ} . \\
P H=\sqrt{P Q^{2}+Q H^{2}}=\sqrt{A B^{2}+\left(\frac{B Q}{2}\right)^{2}}=\sqrt{A B^{2}+\left(\frac{A P}{2}\right)^{2}}=2 \sqrt{2} .
\end{array}
$$
8. $A B$ is the common perpendicular segment of skew lines $a, b$, $A$ is on line $a$, $B$ is on line $b$, $A B=2$, the skew lines $a, b$ form a $30^{\circ}$ angle, and on line $a$ take $A P=4$, then the distance from point $P$ to line $b$ is $\qquad$.