perhaps a better example .
Here relay is inactive in light.
Dark LDR turns off Q1 which turns On Q2 and relay using N.O. contact.
FET's can also be used with some skills, or even CMOS Schmitt trigger and NPN.
R3 provides positive feedback for hysteresis (aka backlash, deadzone, stable flip...