TeX source:
\begin{aligned} &a_{n}=a_{1} r^{n-1}\\ &a_{4}=3 r^{3} & & \text { Write the fourth term of sequence in terms of } \alpha_{1} \text { and } r\\ &24=3 r^{3} & & \text { Substitute } 24 \text { for } a_{4}\\ &8=r^{3} & & \text { Divide }\\ &r=2 & & \text { Solve for the common ratio } \end{aligned}