What happens when a helicopter loses an engine?
Helicopters are able to do something called autorotation if all thrust is lost. 


  In a helicopter, an autorotative descent is a power-off  maneuver in
  which the engine is disengaged from the main  rotor system and the
  rotor blades are driven solely by the  upward flow of air through the
  rotor. In other  words, the engine is no longer
  supplying power to the main  rotor. 




(Look in particular at the direction of flight arrows. Remember there's a lift vector coming of the blades as well in both cases.)

Basically, the collective is decreased immediately when thrust is lost for whatever reason. This allows the airflow coming through the blades to push them around, like a reverse windmill in a way, keeping the blades spinning. This also generates lift, keeping the helicopter generating some lift (while descending of course). 


  At the instant of engine failure, the main rotor blades are 
  producing lift and thrust from their angle of attack (AOA) 
  and velocity. By lowering the collective pitch, which must be 
  done immediately in case of an engine failure, lift and drag 
  are reduced, and the helicopter begins an immediate descent, 
  thus producing an upward flow of air through the rotor 
  system. This upward flow of air through the rotor provides 
  sufficient thrust to maintain rotor rpm throughout the descent. 
  Since the tail rotor is driven by the main rotor transmission 
  during autorotation, heading control is maintained with the 
  antitorque pedals as in normal flight.


Once the helicopter reaches ground, the pilot will pull up. Since the blades were spinning a bit faster than needed for a hover since he was flying forward the whole procedure, he simply pulls up and levels out carefully close to the ground until the helicopter touches down.

This being said, you have to be careful, since if you're flying to slow you can't pull it off.


  When landing from an autorotation, the only energy available 
  to arrest the descent rate and ensure a soft landing is the 
  kinetic energy stored in the rotor blades. Tip weights can 
  greatly increase this stored energy. A greater amount of rotor 
  energy is required to stop a helicopter with a high rate of 
  descent than is required to stop a helicopter that is descending 
  more slowly. Therefore, autorotative descents at very low or 
  very high airspeeds are more critical than those performed 
  at the minimum rate of descent airspeed.


This dangerous conditions are shown in a height-velocity diagram as is seen below, in this case apparently from an R44.



Here's a little video to get an idea of how it looks for the pilot: 


                
            

Autorotation is often time critical and has to be done right as there's only one shot and as such is practised by pilots on a regular basis.

All extracts in this section are from "Helicopter Emergencies and Hazards" by the FAA, an excellent and very extensive publication on the topic.