Photodiode Relay Circuit
BPW34 is a PIN photodiode polarized by a suitable voltage. The reverse current of this diode is very low in total darkness (about 1 nA), but increases in proportion to the amount of light received by the photodiode.
In this circuit, there are two voltage dividers across the 12-volt supply. One leg is the photodiode and the 330k resistor. The other leg is the relay impedance and the emitter-to-collector circuit. The relay is de-energized with no incident light applied to the photodiode. Whenever a beam of light strikes the photodiode, the transistor conducts, picking up the relay.
Useful link: BPW34 datasheet (pdf)