There is a product available now called Feliway which is a synthetic replicate of a cat pheramone. If you spray it regularly where they spray, they will stop spraying there. (There's also another brand, whose name I can't recall.) The pheramone has a calming effect. It's also useful to spray in your cat carrier, if you have a cat which freaks out at travelling. If you have a territorial cat, they'll respond to the smell of their own urine as if it was that of another. The smell of the pheramone makes them think it's no big deal.