Sonar is a system that uses audible “pings” to bounce sounds off of objects and detect their presence, distance or indeed their density. It is, like many technical terms, an acronym - SOund Navigation And Ranging.
It is simple to use for robotics as a quick gauge of distance to an object and can be used for basic object avoidance. This method was used by the Cybot and a sonar module is now present in the Lego NXT. The way it is used by robots is very rarely as sophisticated as creating a sweep of an area as you might see in a submarine movie.
Sonar units may be salvaged from some of the Polaroid cameras, and also picked up from Maplin as car parking sensor kits.
The common HC-SR04 is a cheap and cheerful sonar module that can be used with the Arduino and Raspberry Pi.