Cut away the rotten boards with a jigsaw or keyhole saw. Your cuts must be located next to a support joist on either side of the board section that you are removing.
If there are no gaps between the boards to fit a saw blade, drill a hole large enough for the blade at both ends of the rotten section.
Cut two pieces of 2-by-4 board that match the width of the boards you removed.
Place the board pieces against the support joists, with their top edge lined up with the top edge of the joist. They will serve as horizontal cleats that you can place the new deck lumber on. Clamp them in place.
Drill two 1/16-inch pilot holes through each cleat and into the joist behind it.
Screw the cleats to the joists with 3-inch galvanized wood screws. Remove the clamps when the cleats are in place.
Cut pieces of deck lumber to match the rotten pieces that you removed. Sand their ends with 180-grit sandpaper to remove any splinters.
Set the deck boards in place with their ends resting on the cleats.
Nail or screw the new lumber to the cleats, countersinking the nail or screw heads slightly below the wood surface. Use the same method that is found on the rest of your deck; you don't want to use screws if the rest of the deck has been nailed.
Stain and seal the new section, using the same products as on the rest of your deck.