Well, basically break beam sensor consists of two parts: transmitter and receiver. Transmitter emits light (it could be, for example, an LED or a laser) and that light goes to receiver. If that light beam between transmitter and receiver is broken by some obstacle, and receiver detects no incoming light even for a brief moment – it triggers an alarm (or any load you want). For example you can count people that entering some room, or you can use it as an alarm system, yeah, just like in movies!
First thing that comes to mind is to connect LED or laser to DC power supply on transmitter side, and use phototransistor with an amplifier on receiver side. But that is not gonna work with changing ambient light level. For example you calibrated your amplifier to work on a cloudy day, and then bright sun shined at it and in this case it won’t trigger an alarm because it already has sufficient level of incoming light.
Break-Beam Sensor - [Link]