My cat is marking, and/or peeing outside his box...what to do?

Urine marking can be a real nightmare, especially because the cat pee smell can be very persistant--and if you don't get things under control FAST, the culprit only gets worse and any other cats in the household may follow his lead. (Note that female cats and neutered males can also spray, as well as pee in inappropriate places. This is not just a "tomcat problem".)

First steps:

Sometimes when a cat starts pottying outside the box, it's because he or she has developed a medical problem.
For example, I had one well-behaved boy who suddenly peed in the bathtub—and I did not like the colour of it, either! He was vetted asap, and turned out to have a urinary tract issue that could easily have killed him if left untreated. (Thankfully, he was smart enough to bring this to my attention; had he only peed in the boxes with the other boys, I might not have known.)
Urinary problems are more common in males, especially when they eat dry cat food and don't drink enough water. Cats were originally desert animals, who in the wild would get most of their water from their they don't have the urge to drink a lot of water. They also dislike standing/stagnant water, and prefer running water instead. To help prevent urinary stones or other issues, it's best to feed wet cat food and/or encourage them to drink more often by providing a water fountain or letting them drink from a dripping faucet. (Mine will "ask" for the faucet to be turned on, when they'd like a drink.)
Many other medical issues can result in a cat turning away from his box. Cats tend to hide illness, so sometimes the only major symptom before they're on death's door is that they start acting a little "off". *Always rule out health concerns first when you see a change in behaviour.*

Is the cat neutered?
Intact males have a strong instinct to spray, once they reach sexual maturity (around 6 months of age). Intact females may also be more competitive, especially when in heat. The best way to prevent most spraying behaviour is to spay or neuter your companion.

Did something change in their lifestyle?
Adding new cats, a baby, roommates, a dog, moving to a new house, or any other lifestyle change can stress and dramatically affect your cat. Even changing their brand of litter can upset their routine. (Cats often do not handle change as well as most dogs do.)
Knowing that the peeing is caused by the cat being stressed, can give you insights into how to resolve it. Perhaps the cat can be given a safe, secure, quiet area where he/she can get away from the dog, baby, or other newcomer. Remember that most cats like privacy to "do their business" and they need to have access to a calm place where they can be by themselves, sometimes. You can also try giving an insecure cat more attention (if he's been brushed aside), offer a new bit of territory such as a cat tree, try to minimize disruptions to his feeding schedule, match his litter preference, or whatever counters the change he is having trouble with.

Is the litter box clean? Are there enough boxes?
The rule of thumb is, "one box per cat, plus one". If you have two cats, then you should have three boxes to choose from...if three cats, then four boxes, and so on.
If the litterbox is nasty, the cat may not want to get into it. (Would you? Have you ever dreaded using a poorly kept gas-station toilet?) Keeping the box extra clean and smelling fresh can make the difference. If you use clay litter, you might powder the bottom with baking soda first. If it's scoopable, scoop often.
Some cats really like the newer litters, such as corncob, pine, sand, or crystals. (My own cats have a strong preference for silica crystal litter; it absorbs all odor, stays dry to the touch, is scoopable for poop, and seems to feel good under their paws. It does cost more but it also lasts MUCH longer than clay litter.)

If the cat has been recently declawed, it is not uncommon for him/her to stop using a litterbox. Digging in the litter causes even more trauma to painful post-surgical paws...and the cat may associate this pain with the box itself, causing a permanent aversion to using the box. I would STRONGLY discourage this procedure. It has more serious drawbacks than the benefits are worth, and more importantly, it causes extensive suffering for your cat. There are other ways to handle the cat's need to exercise his claws. More information on DECLAWING (and alternatives) here.

Dealing with the damages/going forward:

Clean up any messes immediately, and thoroughly.
Cats will keep returning to any place they have begun to mark—and the other resident cats may also compete by marking over them, or nearby. Identify the targets and keep them consistently pee-free. (A special effects 'blacklight' or ultraviolet 'scorpion flashlight' will sometimes detect pee spots that you might have missed. A component in cat urine shows up under the blacklight.) Some locations are more appealing to cats than others. Corners of rooms, doorways, and furniture or other objects that make good "landmarks" are often the most desirable places to spray. Laundry is another common target; if you have a spraying cat, keep laundry put up to prevent them from constantly reinforcing their behaviour.

Kill off the smell completely.
Cat pee is stronger than dog pee, and harder to remove. There are products made explicitly for this purpose—alternately, I have found that a mix of 1 part mouthwash, 1 part vinegar, and ˝ part peroxide will kill all of the "bad stuff" in cat pee. You can also add some club soda or selzer water to the mix; I'm told that this increases its ability to break down the pee compounds.
If you are not sure you have found ALL targets, you may want to wash down all walls and furniture with this solution. (Unlike commercial enzyme cleaners, the homemade solution is inexpensive enough to do this with, even on a regular basis...and it doesn't really take too big a chunk out of your day to do. Put some in a spray bottle and spray down the furniture; the walls can be washed with a rag or dish towel dipped into a bowl of the solution, and rinsed out after each pass.) I recommend testing your furniture and such for colour-safeness before going hog wild with the solution. I've had no problems so far, but then again, I don't have expensive "stuff".

Make sure none of the cats are being harassed.
A stressed cat is often a peeing cat. A bossy cat "swinging his dick" (for the benefit of a victim cat) can also be a peeing cat. Inter-cat aggression is a large subject in & of itself, so you may need to read up on it if this is the problem.

Provide "vertical territory".
I have cat trees and cat-shelving all over the place.

This gives uneasy cats a personal place to hide out, and bossy ones a place to survey their domain. If there's plenty of territory to go around, you have a lot less "turf wars". Also, cats don't really like being at ground level, and you can double or triple their perception of how big your house is by adding new stuff to sit/sleep on. (Even something as simple as leftover cardboard boxes or an old towel tossed onto a chair can be attractive "real estate" to a cat! They also offer a welcome distraction.)

Alternative outlets:
-Cats mark by scratching (and also rubbing on things) as well as peeing, so putting up cardboard scratchers and other attractive toys in/around the popular spraying areas (or on landmarks such as corners or big furniture) can sometimes redirect them. If they can scent-mark with their claws, they may do that instead of spraying. It still "claims" the territory.
-Stress can come from boredom or pent up energy. If they have toys they're really into (such as a Cat Track) or you take time to play chase-the-toy or chase-the-laser-pointer games with them, sometimes that blows off their "bad" energy & they will mellow out.
-I've found that few things compare to the great outdoors when it comes to "environmental enrichment".

IF you are able to fence a small area outside a window (even one roll of cheap wire weld fence can be enough, and most cats don't seem to climb 6' fence) and put a cat door in the window, that can be a big help. It also gives them an acceptable place to mark! I've had several cats who ONLY marked outdoors, just like a dog. If there's a tree inside the fence, so much the better.

Getting on their case.
You can correct them for spraying by squirting them with a squirt gun or spray bottle. You can also scoop them up & put them in a crate, laundry room, etc. Be very cautious with "punishment", though, when it comes to cats. They can easily be made to fear and distrust YOU, in general, instead of associating your anger with their misbehaviour. Unlike dogs, cats do not practice physical punishment as a way of training each other (if cats get physical, they mean business) and the concept of "correcting group behaviour through violence" is foreign to them.

Don't neglect to praise and reward GOOD behaviour!
This goes a lot further than punishment, especially in the long run. Help each cat feel secure and loved. Praise and offer catnip or special treats whenever you see the problem cat getting along with—or even ignoring—the other cats. Pet the cats at the same time, feed them special canned food together, brush them with the same brush. Tell them how proud you are that everyone gets along and is part of the family. (Yes, I know how silly that probably sounds, but it also works. Silly, or pee-infested...your choice.)
Praise and treat profusely for any scent marking that's done by *rubbing on things or scratching their toys*, instead of spraying.

Some people have great success with Feliway but that can get cost-prohibitive for a large house. House size vs finances are going to vary for people so this may or may not be an option.

Management (OR, "Making the best of it"...)
*If you have a cat with whom you've tried everything else, and you are DETERMINED to make it work, then read on.*

Sometimes you simply can't allow a wayward cat to have free run of the house. The "naughty" or "clueless" cat may need to be restricted to one room (or excluded from one specific room). Some cats may need to be managed even more carefully, and only allowed house access under supervision. For example, my blue cat Rio Just. Doesn't. Get it. There's no known reason for his behaviour, but if you let him loose, he will mark all over. I had to settle on a drastic solution: during the day, he goes outside in a fenced yard. At night (or in inclement weather) he stays here:

in a cage built into my living room. He's got a large enclosed litter box, window, high shelf, a soft chair, some toys and a blanket...and seems content enough, especially when you factor in human attention, catnip and treats. If you can't build a large indoor enclosure, you might use a 'cat cage' or even a Great Dane sized crate for when the cat is "under restriction". As long as he gets plenty of attention, and time out for play and exercise, this can be made to work. I would never advocate this lifestyle for a normal, healthy cat—but in my estimation, it still beats putting the cat down...though I am not sure everyone would agree that their cat is worth it. I guess when you get to this extreme, it can really be a tough call.

I had one "serial killer" foster cat who was not a "pee-er", but was extremely other-cat aggressive. He had his own room, complete with small fenced yard. It's not ideal but it solved the problem and he got to live. (He eventually got adopted to a single cat home.) I used to let him sleep in a large wire crate in my bedroom at night. It had his necessities plus a cardboard box "house" in it so he either could hide inside the box, or be raised off floor level by lying on a towel on top of the box; his choice. (For what it's worth, this is also the setup I use when I need to travel with cats in the car.)

Another solution for cats who can't seem to be retrained, is to allow them ONE room in the house that attaches (via a cat door in a window)

to a large fenced area—or to the Great Outdoors, if you live far enough out in the country. This provides a warm, safe place for food, water, bedding, high shelves or a cat tree, toys, etc while also letting them utilise 'nature's bathroom' and find fun outlets for play and exercise out there.

Here is another example of a "cat station"--it provides food, water, and higher ground for a cat confined to an enclosed porch and yard during the day.

If finances allow, you could even fence a nice sized area around a cat-equipped barn or wooden shed, and let that be their living arrangement when you're not spending time with them. If you are truly committed to making it work, you are often limited only by your creativity. However, very few cases should ever have to go to this extreme.

Hopefully this gave you some ideas on working with your troubled kitty. You may also want to check out this link on creating happy cats. :-)
If you have ideas to share that I haven't mentioned here, please drop me a line! I would love to hear from you.