I have used Feliway to stop occasional spraying, and it seemed to work well. Unfortunately, now when I stop using it the spraying resumes – so they have me hooked.
However, if it is just confined to the litter box it might be another problem. Cats can be very finicky about the litter box.