FOR many people, there is something magical about icicles hanging from the eaves of a snow-covered house. But to those who know houses well, icicles are a sign that something bad might be going on under the roof.

The icicles, experts say, are a byproduct of an “ice dam,” a buildup of ice on the roof along the overhang, or eave  the part of the roof that extends beyond the exterior wall. The buildup is a result of energy loss from inside the house, which could cost a homeowner hundreds of dollars or more. It could also lead to problems like rotted roofs and rafters, ruined insulation, moisture inside the walls, mold, peeling paint and even physical injury from falling icicles.

Ice dams form when the upper part of the roof is warm enough to melt snow and the eaves are cold enough to freeze the runoff into icicles. What typically causes a roof to be warm is air from inside the house seeping into the attic and heating it up. When water from melting snow gets to the cold spot where the eaves begin, it re-freezes and creates a dam, and then a pool of water accumulates behind it.

At that point, two things usually happen, said Richard Stone, an extension educator in housing technology at the University of Minnesota Extension in St. Paul. First, the water in the pool rises high enough to migrate back up the roof and under the shingles, exposing the surface of the roof to rotting. Second, water flows over the dam to form icicles at the roof’s edge.