4. Given the equation
$$
x^{2}+(b+2) x y+b y^{2}=0(b \in \mathbf{R})
$$

represents two lines. Then the range of the angle $\theta$ between them is
4. $\left[\arctan \frac{2 \sqrt{5}}{5}, \frac{\pi}{2}\right]$.

When $b=0$, the two lines represented are $x=0$, $x+2 y=0$, and their angle is $\arctan 2$.
When $b \neq 0$, $b\left(\frac{y}{x}\right)^{2}+(b+2) \frac{y}{x}+1=0$, $\Delta=(b+2)^{2}-4 b=b^{2}+4>0$.
Let the slopes of the two lines be $k_{1}$ and $k_{2}$. Then $k_{1}+k_{2}=-\frac{b+2}{b}$, $k_{1} k_{2}=\frac{1}{b}$.
When $b=-1$, $k_{1} k_{2}=-1$. At this time, the angle is $\frac{\pi}{2}$.
When $b \neq-1$,
$\tan \theta=\left|\frac{k_{1}-k_{2}}{1+k_{1} k_{2}}\right|=\frac{\sqrt{b^{2}+4}}{|b+1|}$.
Let $t=b+1$. Then
$\tan \theta=\frac{\sqrt{(t-1)^{2}+4}}{|t|}$
$=\sqrt{\frac{4}{5}+5\left(\frac{1}{t}-\frac{1}{5}\right)^{2}} \geqslant \frac{2 \sqrt{5}}{5}$.
In summary, the angle $\theta \in\left[\arctan \frac{2 \sqrt{5}}{5}, \frac{\pi}{2}\right]$.