Normally, there is a light source and detector in a box with a retro-reflector mounted on the other side. When the beam is broken, either a solid state switch or relay is activated. That will in turn provide either a ground on one wire or a dry closure between two wires. I would guess that if it has three wires, two are power and the third is the control lead that will either add or remove a ground upon breaking of the beam. If it has four wires, two are for the lamp power the other two are the relay contacts.
The best way to know for sure is to pull one apart and draw out the schematic since you have several examples to play with.