Why
Cats are distinctly aware of territory and make their mark by scratching and spraying urine. Males do this to tell other males that the area is spoken for; feline intruders are chased off or attacked by the resident male. Marking territory also alerts females to the male's presence.
Rivalry
If you have a cat, chances are that he's aware of other cats wandering through the yard, even if he is kept indoors. He watches other cats through the windows, and if stray cats are marking territory near your house, it sometimes instigates a marking war between the animals. If your cat suddenly begins marking his territory, he is reacting to the smell of another cat's urine.
Feral Cats
Feral cats are animals raised in the wild, ill-suited to living in a home. Though they're fearful of humans, they seek food and shelter nearby. Trap-neuter-release (TNR) has proven to be the best method for dealing with feral cat populations. Relocation and eradication only create a void for new feral cats to fill. TNR aims to reduce populations by trapping feral cats, neutering them and then releasing them back into the wild.
Solutions
Cats kept indoors not only don't mark territory in neighbor's yards, they aren't exposed to disease or parasites. If you suspect that the cat marking your property belongs to a neighbor, encourage her to keep the cat indoors. If she is unresponsive, or if you don't know who owns the cat, the ASPCA recommends using humane methods such as sprays, motion-activated sprinklers or ultrasonic repellents.