Cover all ducts and vents so that they can be uncovered after installation.
Place a cardboard barrier across the door to the room in which you are working. This will help prevent foam particles from entering the living areas of the house.
Wear protective clothing and a face mask. Spray foam contains chemicals that can irritate the skin.
Fill the reservoir of the pressurized air machine with the liquid foam and plug it in.
Hold the hose of the machine about 12 inches from the area you wish to insulate. If this is not possible for hard-to-reach areas, get as close to this distance as you can.
Spray the foam in a quick side-to-side motion. Hard-to-reach areas are often very confined, and you do not want to overload a confined area, given that the foam will expand as soon as it hits the wall.
Apply the foam directly around pipes and electrical boxes in hard-to-reach areas.
Allow the foam to expand and harden, then trim it so that it's flush with joists or other structural elements. In larger spaces, you would use a saw, but if the area is confined, use a utility knife.