This page is a basic overview of Active and passive sonar
A transducer in an active sonar system converts electricity to sound and sound to electricity. It makes a sound or "ping" and listens for the reflection of that sound. It takes the time from the transmit to the receive of the ping, multiplies the time by the speed of sound, and divides the total by 2 (because the sound has a 2 way trip to the object and back). This is how the system determines ranges. To determine direction the system has a bunch of transducers that all send out sound in different directions (see "Fig.1" below for example). The transducer that receives the sound is in the direction of the reflected object.
Important note:
All these diagrams were taken from http://www.fas.org/man/dod-101/navy/docs/es310/asw_sys/asw_sys.htm
Here is a diagram of an active sonar system
Fig. 1 An active sonar system
The main difference between Active and Passive Sonar is that Active Sonar makes a "ping" and listens for a reflection and passive sonar does the same, just without making a ping. A passive system hears a sound and compares that sound to a database of sounds and determines the source. Although a passive system cannot "see" an object it can tell what it is. A passive system determines direction the same way an active system does.
Fig. 2 a passive sonar system
This is another basic diagram of a passive Sonar system( taken from http://www.fas.org/man/dod-101/navy/docs/es310/asw_sys/asw_sys.htm):
Fig.3 Another passive sonar system