Example 11 In a scalene $\triangle A B C$, two of the altitudes are 4 and 12. If the altitude to the third side is also an integer, then the longest possible value for this altitude is ( ).
(A) 4
(B) 5
(C) 6
(D) 7
Solution: Let the area of $\triangle A B C$ be $S$. Then the sides corresponding to the two given heights are $\frac{2 S}{4}$ and $\frac{2 S}{12}$. Let the third height be $h$, then the third side is $\frac{2 S}{h}$. Clearly, $\frac{2 S}{12}<\frac{2 S}{4}, \\
\frac{2 S}{12}+\frac{2 S}{4}>\frac{2 S}{h}
\end{array} \Rightarrow 3<h<6 .\right.
$

Therefore, $h$ can be at most 5.