4. As shown in Figure 1, in a cube $A B C D-$ $A_{1} B_{1} C_{1} D_{1}$ with edge length $a$, points $E$ and $F$ are the centers of faces $B B_{1} C_{1} C$ and $A B C D$, respectively. Then the distance between the skew lines $E F$ and $A_{1} C_{1}$ is ( ).
(A) $\frac{a}{2}$
(B) $\frac{\sqrt{2}}{2} a$
(C) $\frac{\sqrt{3}}{3} a$
(D) $\frac{\sqrt{6}}{4} a$
4. (C).

As shown in Figure 3, connect $A_{1} C$ and $A B_{1}$.
Since $A_{1} C_{1} \parallel A C$, the distance from line $E F$ to $A_{1} C_{1}$ is equal to the distance from line $A_{1} C_{1}$ to plane $A B_{1} C$, which is also equal to the distance from point $A_{1}$ to plane $A B_{1} C$. Let this distance be $h$. Then $V_{A_{1}-4 B_{1} c}=\frac{1}{3} h \cdot S_{\triangle A B_{1} c}=\frac{\sqrt{3}}{6} a^{2} h$. Also, $V_{4_{1}-A B_{1}} c=V_{C-A_{1} B}=\frac{1}{3} \cdot a \cdot \frac{a^{2}}{2}=\frac{a^{3}}{6}$. Therefore, $\frac{\sqrt{3}}{6} a^{2} h=\frac{a^{3}}{6}, h=\frac{\sqrt{3}}{3} a$.