Cut 2 inches off the top of the soda bottle.
Glue a piece of barbwire over the top opening of the bottle. Size the barbwire so that is it exactly the shape and dimensions of the bottle's opening. The barbwire should replicate a swinging door.
Glue a toothpick across the opening of the bottle. Place the toothpick high enough to stop the barbwire from swinging outward but low enough for the rat to be able to step over it.
Put a spoonful of peanut butter at the uncut end of the bottle. Peanut butter attracts rats and mice to the location.
Place the bottle in an area where rat infestation has occurred. Position the bottle so the opening is an entrance. The rat can not escape once it enters because the toothpick prevents the barbwire from swinging outward.