IR counter

This what I want to implement is ...
when something(some thing) break the light beam, the counter will be incrementing. I don't need to know how far this thing is. And I'm not sure which sensor will be the best for this kind of task.