Put on a layer of protective clothing, including goggles and a respirator. Do not leave any skin or hair exposed.
Connect your sprayer to the foam source, following the specific instructions for your sprayer unit.
Spray a small area of the joists with foam. Note the degree of expansion. Since spray foam can expand greatly, you will want to be sure not to spray too much in the joists.
Spray with even strokes, covering the area and moving to the next bare patch of joist.