Our upstairs ceilings are only framed with 2x4 rafters, so after leaving a gap for ventilation under the sheathing, I've got to do what I can in about 3" of space. I fit sheets of 2" foam insulation board into each bay, fitting it to the slopes and outlines of the framing, and leaving about 1/2" gap all around. The stuff can be cut fairly easily with a big serrated kitchen knife, but you have to be careful to keep the cut from wandering.
|Cut all the angles for a reasonably tight fit|
|2" foam panels installed in the ceiling|
|Wood battens hold sheeting while foam cures|
|Trim off the excess with a long flexible knife|
|Be careful not to overfill with expanding foam - see how it pushed the electrical box down.|
I had to carve out the excess and re-seal this one.
|Perpendicular furring strips allow foam insulation to cover framing|
In the end I've got a 4-1/2" thin ceiling / roof assembly that is well ventilated under the roof deck, but still about R-20 and totally sealed against air leakage. Loose insulation materials like fiberglass and cellulose might rate well in an otherwise sealed cavity, but if there's infiltration into the stud bay or of course in a vented attic, I think foam has some serious advantages that aren't apparent when all you look at is the R-numbers.
Tips: Definitely always wear some kind of eye protection, thin nitrile gloves, and a hat when spraying canned foam. It occasionally pops and you don't want this stuff in your eye. It also is a real pain to get off your hands, and I guarantee you'll get it in your hair if you're working on a ceiling.