This reflectance sensor
packs an IR emitter and detector in the same physical package, but it's functionally equivalent to using two discrete pieces. Scroll down a bit on the page for the schematic to see how the emitter and phototransistor would be wired up. The "out" pin will show a varying analog voltage depending on if something is blocking the light or not.
Be warned that IR phototransistors are sensitive to ambient light and it will not be practical to have a lot of distance between the emitter and phototransistor (a foot at best?). If you need more distance you can use a red laser pointer as the coherence of the beam will keep the phototransistor well saturated with light (the laser is "brighter" than expected ambient light). If you need even more reliability you can use a three-pin IR receiver, as would be used with a TV remote control, and send TV-like signals to the receiver. the IR library
will help you with this. Doing things this way makes it impervious to ambient light -- it's a coded light beam, after all.
If you do use an IR emitter I suggest testing with a red LED so you can actually see what's happening. IR phototransistors/receivers are still plenty sensitive to red wavelengths.