Mine! Mine! Mine!
Cats are creatures of habit. They like having their own space, their own toys, and their own stuff. They can share and cohabitate, but they need something that is theirs to be happy. If they think something that belongs to them is being taken over by something else, including you, the owner, they will feel threatened.. So they will answer a threat sometimes.
They have to let everyone know they own it. The natural way to do this is to claim it and to mark it with urine. This is like writing their name on things. Sometimes just putting their scent on something, or in a certain area, will make them feel secure, especially if they feel out of place, nervous or fearful.
They are not being spiteful. They are upset over something. They need to be reassured. You need to make sure that your cat does not have a medical problem. If the veterinarian tells you that he/she is fine, then think about what is going on in his/her life. First give him/her lots of attention. They need to know that you care. Don't scream at them. Don't rub its nose in it. Don't throw them into the litter box. This will make them more nervous, more upset, and more afraid of the litter box.
Some things that could cause them to spray or mark are you bringing home something new such as another cat, dog, baby, or furniture. If it's another pet then introduce them slowly. Let them get used to each other. Remember to let them know that you still love them. They will need lots of your attention to accept this change. If you bring home a new family member, have your cat acclimated to the smells and sounds that accompany them. Still make sure that you give him/her lots of attention. Cats need to be assured of their place in your home and heart. If there are cats outside, they may be in your yard, marking it, claiming it. Well, your cat will claim it too, he/she will let them know this is not their yard, by peeing on windows, glass doors, and anywhere he/she think they will notice. You can help your cat feel secure by getting rid of the cats out there. Find out who they belong to and tell their owners so they can keep them closer to their home. If they are strays, you can call a local humane society. If you cannot keep the cats away, then block my vision of them. You can put newspaper, foil or reflective tape over the window so I cannot see them. Cats will not spray unless they have to.
After finding out what is bothering your cat, it will be important to clean the areas that he/she marked with a special enzymatic cleaner that is specially made to take away the scent. If your cat continue to smell the mark there, he/she may continue to mark it. You may have to keep your cat away from that area for a while, 'out of sight, out of mind.' There is also a natural pheromone spray called Feliway, which can be very calming to some cats and reduces the urge to spray and mark. If you spray this around the areas that your cat have marked because he/she was uneasy, it may calm him/her. Your cat needs you to help him solve its uneasiness. They need you to help them feel secure. They don't want to lose anything, especially you.