An ice dam is not a roofing problem, even though that is where the water shows up.
An ice dam is not a roofing problem, even though that is where the water shows up. It forms when warm air reaches the underside of the roof sheathing and melts the snow above it; the meltwater runs down, hits the cold eave and refreezes into a ridge that backs water under the shingles.
Warm air is escaping into the attic and heating the sheathing from below. The escape routes are predictable: the top plates of partition walls, recessed light housings that were never rated for insulation contact, the chimney chase, plumbing chases, and the attic hatch. Sealing those paths drops the temperature of the roof deck and the melt stops.
New shingles and an ice-and-water shield manage the water rather than the heat, which is why the dam returns. Heat cable works while it is energised and running, and then it does not. Neither addresses the air that is doing the melting. Sealing the ceiling plane is the only fix that changes the cause.
Air-seal the bypasses, then insulation to a target R-value with the thickness measured rather than estimated, then baffles at the eaves where the attic stays vented, and a sealed hatch cover. If the roof has a separate flashing or ventilation defect, that is roofing work and should be priced separately.
Air-sealing the ceiling plane is the part that stops the melting. Foam does that as part of the insulation, but only if the bypasses are actually treated - foam sprayed over an open top plate leaves the air path intact.
Only if the attic is living space, or ductwork or mechanicals are up there. Otherwise insulating the ceiling plane does the same thermal job for less money, because the ceiling area is smaller than the deck area.
The dense, structural foam. It insulates, air-seals and adds rigidity in one pass.
The softer foam, cheaper per inch, and unforgiving about where you put it.
Most Boston attic problems are air problems wearing an insulation costume.