The "Locks" are long narrow chambers with gates at each end that lock the water in. A ship goes into a chamber, the gates are closed and water is pumped in or out to raise or lower the ship to a new level.
The Panama Canal has three sets of Locks. The Gatun locks are on the Caribbean side. Ships go into the locks at sea level. The gate is closed. Water is pumped in and the ship rises to the level of Lake Gatun.
The ship sails across the lake and the canal and enters the Pedro Miguel Locks where it is raised again.
It sails across the canal and enters the Miraflores locks where it is lowered to the Pacific Ocean's sea level.
Reference: http://encarta.msn.com/encyclopedia_761559188/Panama_Canal.html