Litterbox problems are not unusual for cats. There are many possible reasons. Your cat has decided that the litterbox is an unpleasant place to be. The box may not be clean enough, or he/she may have experienced painful urination or defection in the box. Your cat may have been startled by a noise while using the box or perhaps been "ambushed" while in the box by either another cat, a child, a dog, or even by you (if you were attempting to catch him/her for some reason). This kind of an aversion may require you to completely replace the litterbox so it no longer reminds your cat of unpleasant experiences. You may need to buy a new box, put it in a new location, and use a different type of litter. Remember to keep the box clean - scoop everyday, and completely change the litter anywhere from every three days to once a week.
If stress is involved, you may see other behavioral or physical changes as well, such as, weight loss, fearful behavior, or changes in eating or sleeping habits. Punishment is not a way to resolve a litterbox problem. First, check with your veterinarian. Health problems can cause litterbox problems.
It has been said that booby traps, placed in the location of the soiling, may discourage pets from repeating the behavior in the same location again. Tricks include two-sided carpet tape, which pets don't like to walk on, a string of empty soda cans, small alarms set off by motion, balloons set up to pop against a tack on the wall if bumped by the cat, and mouse traps set upside down provide a quick, safe scare to the cat. Pet owners should consult their veterinarian before setting up any traps.
Some information above came from Feline Housesoiling (Acme Pet).