We like this infrared proximity sensor
from pololu (made by Sharp). It is affordable, but only gives digital (binary) output: something is in front of it or something is not. If you are looking for how far away something might be then you will need to use a more expensive analog sensor. There are infared
, and (if you got lots of $$$ to burn) laser varieties.