Insert a tube of silicone caulk into a caulk gun. Cut off the tip of the tube with scissors. Run a bead of silicone caulk along the seam where the ceiling's sill plates meet the wall to seal any air gaps the insulation will not reach. If the ceiling is sloped, run a bead of caulk along the seam where the two sloped sides meet.
Measure the length of the gap between two ceiling joists, either from side to side or from top to bottom, depending on whether the joists run vertically or horizontally. Transfer this measurement to a piece of rigid foam insulation and mark it with a utility knife.
Lay a 4-foot level across the insulation, with the edge lined up with the measurement and mark you made on the insulation. Cut the insulation along the level with a utility knife.
Insert a tube of construction adhesive into a caulk gun. Apply two generous beads of caulk down the rigid foam insulation's back side. Make the lines curvy to cover as much surface area as possible.
Lift the insulation into the gap between two ceiling joists. Press it firmly against the ceiling.
Repeat Steps 2 through 5 as you work your way across the ceiling, filling every gap between ceiling joists with rigid foam insulation.