You can use a hot pepper repellent spray, which uses the active ingredient, capsaicin (the compound extracted from hot peppers). There are commercial pepper sprays available, or you can mix up your own. There are a number of recipes available online, which use capsaicin, in some form (eg. cayenne, hot sauce, crushed red pepper flakes, etc.).
Wear gloves and goggles when applying pepper spray, because it is a skin and eye irritant. Also avoid spraying on windy days.
It won't harm the animal, unless you spray it directly onto the animal. It is suppose to serve as a repellent, and the animal won't want to go near it. Of course, you will likely need to reapply, as needed.