A friend of mine monitors his hallway with a light beam sent lengthwise down his hallway like you suggest. The obvious design is to put the transmitter in the center of one end wall and the receiver in the center of the other end. It's obvious, but impossible, because the ends are likely to be doors, desks, or decorations.
If nobody is expecting it, it's almost as effective to put them in opposite corners.
Cheapest and easiest is to send 38kHz bursts from an IR LED to be received by an IR module made for a remote. This is tricky if you don't know what you're doing.
1) Put a lens in front of the LED to focus most of the energy towards your receiver. You don't want to waste energy screwing up your TV in the adjacent room anyway.
2) Put the IR LED in a socket. Replace it with a red LED while you focus your optics.
3) Send 1ms bursts of 38kHz, separated by silent periods of 4ms. A pair of 555s or a 556 will do this easily. The 38kHz sensors don't like continuous signals.
4) The receiver should be producing 1ms pulses with 4ms pauses. Look up 'missing pulse detector' here or on the net to see what to do with the sensor output.
5) Note that the transmitter and receiver can be independent, and on different power sources.
Good luck.
-Mike