4. As shown in Figure 1, quadrilateral $A B C D$ is a rectangle, $A D=a$, $C D=b$. If points $E, F, G$ are on sides $B C, A D, D C$ respectively, and $\angle D A G=\angle C G E=\angle D G F$, then $\frac{E G+F G}{A G}$ equals ( ).
(A) $\frac{a}{b}$
(B) $\frac{b}{a}$
(C) $\frac{b}{a}+1$
(D) $\frac{2 b}{a}$
4. B.

Let $\angle D A G=\angle C G E=\angle D G F=\theta$. Then, by the given conditions,
$$
E G=\frac{G C}{\cos \theta}, F G=\frac{D G}{\cos \theta} .
$$

Thus, $E G+F G=\frac{G C+D G}{\cos \theta}=\frac{D C}{\cos \theta}$, and
$$
A G=\frac{A D}{\cos \theta} \text {. }
$$

Therefore, $\frac{E G+F G}{A G}=\frac{D C}{A D}=\frac{b}{a}$.