A.Bruce Harley, technical director of Conservation Services Group in Westboro, Mass., responds: Canned foam might seem like a quick, easy way to provide both fire blocking and air-sealing, but unfortunately there's no such thing as fireproof spray foam. All urethane foams (including several brands labeled as "fire block") are combustible; they can't be used next to chimneys, and they can't be used for sealing penetrations in fire-rated assemblies. These "fire block" foams differ from other canned foams only in that they've had a service evaluation to qualify for "fire blocking" in type V (combustible) construction, which is typically limited to sealing annular spaces of limited size around wiring and plumbing penetrations in top plates and — by extension — other holes of limited size between wall cavities and attics.
Interestingly, the list of code-approved fire-block materials (2006 IRC, R602.8.1) specifies mostly combustible materials, which can't be used in contact with a chimney. The only noncombustible materials on the list are fiberglass and mineral wool, which don't stop air flow and thus are ineffective both as fire blocks and as air barriers against heat loss. So the only way you can technically meet code is by combining sheet metal — acceptable next to a chimney, despite its absence from the list — with glass or mineral wool, which should be placed over the top of the metal without completely filling the gap between the masonry and framing.
When the chimney is exposed, an alternative is to cut back the ceiling drywall and patch in strips of noncombustible cement board, butting them to the masonry and sealing the gap with fireproof caulk (see illustration, left). Fire blocking is required at each level, at either the top or bottom of the joists, whereas draft-stopping is important primarily at insulated ceilings and floors that are part of the home's thermal boundary.
In parts of New England, it's common to strap the underside of sawn floor joists before hanging drywall; although the gaps between the bottom of rough openings and the drywall should be sealed, they are often missed. Foam sealants are fine here, since these areas are outside the 2-inch clearance zone. Other potential trouble spots are the large openings where the top plates of the surrounding walls fall outside the rough openings in the joists; here you may need a larger plywood fire block.
The metal-and-caulk method you describe is one that I typically use in attics, but an alternative approach is to frame tightly around the chimney with steel studs, then use solid steel channel at the top as a fire block. Of course, you'll still need to seal gaps with fireproof caulk.
The same rules apply to prefabricated metal chimneys. These are easier to seal because manufacturers offer sheet-metal fire-block kits that fit their chimneys and provide the necessary clearances.