talked to the guy that put on my roof. It is a vented ridge cap and he advised against the foam.
I will need to fix it from outside by replacing the closures sections, but I can't do that until spring. He thinks that stuffing some insulation in from underneath should be good until I can get on the roof.
I really don't know if this will work. I have tried stuffing things in crack of my shed and when the wind blows hard enough the snow/rain still blows through.
I tried blocking the ridge vent with foam but it just absorbs the moisture and drips down through the vent. Same thing happens with fiberglass insulation. I suppose it depends on the design of the ridge vent.
My roofer also advised against doing it because it could void the roof warranty should something happen. Companies these days look for ways to avoid paying out on warranty claims.
Ok, I've been doing a lot of research on this recently.
There are two types of spray foam. Closed Cell vs Open Cell. The closed cell foam is water proof and can be used as a vapor barrier including under slab. The open cell is not considered waterproof. I'm not sure what the Great Stuff spray in a can is, but I assume it is the open cell.
As far as vents, there are two basic attic insulation systems.
Thin roof, and heavy insulation on top of the ceiling between joists. This type needs attic vents to keep the attic cool. This can be either a ridge vent, or a number of those circular cans scattered across the roof.
Roof + Spray Foam over the entire underside of the roof. Ceiling joist insulation is not needed.
So done right, the spray foam would be done when building the house.
Retro adding a full spray under the entire roof would be expensive, and you'd end up with a double insulated attic which may not function as desired.
Anyway, I would advise against running to town and purchasing a bunch of cans of spray foam and filling your roof vents. You also likely don't want to stuff the vents full of rubber or anything else to block them off.
I don't know about wind blown rain or snow. Water doesn't like to travel uphill, but snow is lighter. So you may have a greater problem with snow than with rain.
I'll have to look at vented ridge cap designs. I was planning on not doing it in the shop, but may do it in the house. One has to be careful not to cut the roofing too short. I think some of the vented ridge caps forced water to flow straight up which wouldn't happen much with rain, but potentially still would be vulnerable to heavy wind blown snow.