5. As shown in Figure 3. Given that three circles with centers at $A$, $B$, and $C$ are tangent to each other and all are tangent to line $l$. If the radii of $\odot A$, $\odot B$, and $\odot C$ are $a$, $b$, and $c$ ($0<c<a<b$), then $a$, $b$, and $c$ must satisfy the relationship ( ).
(A) $2 b=a+c$
(B) $2 \sqrt{b}=\sqrt{a}+\sqrt{c}$
(C) $\frac{1}{c}=\frac{1}{a}+\frac{1}{b}$
(D) $\frac{1}{\sqrt{c}}=\frac{1}{\sqrt{a}}+\frac{1}{\sqrt{b}}$
5.D.

As shown in Figure 6, draw perpendiculars from points $A$, $B$, and $C$ to line $l$, with the feet of the perpendiculars being $A_{1}$, $B_{1}$, and $C_{1}$, respectively. Draw $A B_{2} \perp B B_{1}$, with the foot of the perpendicular being $B_{2}$, and connect $A B$. In
Rt $\triangle A B B_{2}$, we have
$$
\begin{array}{l}
A B^{2}=A B_{2}^{2}+B B_{2}^{2} . \\
\text { Also, } A B^{2}=(a+b)^{2}, A B_{2}=A_{1} B_{1}, \\
B B_{2}^{2}=(b-a)^{2}, \\
\text { Therefore, }(a+b)^{2}=A_{1} B_{1}^{2}+(b-a)^{2} .
\end{array}
$$

Thus, $A_{1} B_{1}^{2}=4 a b$.
Similarly, $A_{1} C_{1}^{2}=4 a c$, $C_{1} B_{1}^{2}=4 b c$.
Since $A_{1} B_{1}=A_{1} C_{1}+C_{1} B_{1}$, then
$$
\sqrt{4 a b}=\sqrt{4 a c}+\sqrt{4 b c} \text {. }
$$

Hence $\frac{1}{\sqrt{c}}=\frac{1}{\sqrt{a}}+\frac{1}{\sqrt{b}}$.