It depends on what the range is you want to measure.
For larger ranges you can use an ultrasonic sonar sensor or a PIR sensor (passive infrared). From my experience, PIR is very good at detecting people, but sometimes not as good at detecting anything else. Sonar can detect most anything pretty accurately.
At shorter ranges you may consider using a capacitance sensor or an IR LED and a phototransistor.
It depends what you are trying to do.