How close do you have to be to an underwater black box to detect it?
This excellent explanation is taken from Avionics News in 2006:

FDRs are equipped with an Underwater Locator Beacon (ULB). If you look at a picture of an FDR, you will almost always see a small, cylindrical object attached to one end of the device.

If a plane crashes into the water, this beacon sends out an ultrasonic pulse that cannot be heard by human ears but is readily detectable by sonar and acoustical locating equipment.
There is a submergence sensor on the side of the beacon that looks like a bull's-eye. When water touches this sensor, it activates the beacon.
The beacon sends out pulses at 37.5 kilohertz (kHz) and can transmit sound as deep as 14,000 feet (4,267 m). Once the beacon begins &quot;pinging&quot;, it pings once per second for 30 days.

Newer FDRs can now transmit as deep as 20,000 ft.
The following table is taken from a fascinatingly detailed article on Hydro International about the retrieval of black boxes. It shows the radius you can pick up the signal of a pinger from:

Notice that if pingers were replaced with more powerful transponders, the range could be drastically improved!
The article also points out, that in very deep water:

under normal conditions, the existing pinger would not be detectable from the surface in depths exceeding 2km