Ice dams occur when snow melts near the ridgelines of warm roofs (roofs without adequate ventilation). As the water runs down the roof to the overhang, it cools and freezes. If the snow continues this melt and freeze process, an ice dam can form that can seep under the shingles, through the decking and into the house. This, of course, can cause serious roof leaks--even in freezing temperatures. The best prevention to ice dams is a well-ventilated roof. Additional protection for your roof can be applied with an impermeable ice and water membrane. The membrane is installed on top of the decking, under the roofing material.
Temporary prevention of ice dams can also be done through the use of electric cables along the eaves of the roof (where the dams usually form). However, new ice dams can form above the cables and still cause extensive damage. Another emergency solution to ice dams is to fill a sock or nylon with calcium chloride. Lay the stocking vertically across the ice dam. The calcium chloride will melt the ice and release the water so that it can drain outside, and not inside your roof.