Sonar is an acoustic wave (whose uses are roughly analogous to radar) and whose name is an acronym for "sound navigation and ranging." Sonar consists of pulses of sound waves are transmitted into water, usually at ultrasonic frequencies in the range of 20-100 kHz. They travel out and are reflected by a solid object. The reflected signals are detected and then correlated to give the operator an indication of the distance and bearing of the object.
There are some fundamental differences to note between sonar and radar. First, the frequencies used for sound are much lower, since sound is highly attenuated at frequencies higher than 100 kHz. Secondly, the speed of sound (331m/s) in water is much slower than that of a radio wave in air, so the time between the transmitted and received pulses is much greater for sonar. Thus the correlation needed to determine bearing is different. Thirdly, the speed of sound in water varies with depth, temperature, and even salinity, and all these parameters need to be known for accurate determinations.