Photodiode for light barrier

Classicly, you need a "transimepance amplifier" connected to the PD.
see
http://www.jensign.com/PhotodiodeAmpDesign/

A 1 meg R feedback with a 100 pf cap across it might work, to prevent oscillation.

This approach minimizes internal capacitance of the PD and increases BW.

jb