Although it is not likely to actually get rid of rats, pepper is a fairly effective rat repellent, which can stop the rats from chewing on wires or causing other damage. Spraying the wires or other areas with hot pepper sauce should teach the rats not to chew on those areas as the spiciness of the pepper causes a very unpleasant sensation.
Virtually any type of pepper or other spicy food is suitable as a rat repellent, including Chinese hot mustard, hot pepper sauces, horseradish or wasabi. Some people call for making a mixture of cayenne pepper and water, while the People for the Ethical Treatment of Animals recommends making a mixture of salad oil, garlic, horseradish and lots of cayenne pepper. PETA states that this mixture should sit for four days, after which the user should strain it into a spray bottle and then spray it on any areas where the rats are causing a problem, such as under the hood of a car.
In addition to pepper, other possible deterrents for rats include mothballs, ammonia and peppermint oil. Homeowners can use both ammonia and peppermint oil by soaking cotton balls and placing them around the property to deter the rats from entering.