I have had two old cats do this. This is why: they get arthritis in their hips and back legs and can no longer do the squat that is required to get the urine inside the box. Instead, the urine arcs a bit and lands outside even though the cat is inside the box. This upsets them terribly and they cannot help it. My solution was to get a sweater box plastic container that was really large, like one of those for under-the-bed storage, and use that as a litter box. My cats tried and tried to do this right, but sometimes their back end collapsed. It's easy enough to clean up the urine. Old cats are worth it.
Your cat may be urinating outside the litter box because the litter box may not have been cleaned properly. Other causes include the litter box sides are too high, the litter box may be in an uncomfortable place or the litter box may be cramped. Check out http://pets.webmd.com/cats/guide/solving-cat-litter-box-problems for more information.
If the litter box is clean, your cat may be failing to use it sometimes because his memory might be going bad. Eighteen is a pretty old cat. You could have him checked by the vet to make sure he doesn't have cystitis.
Awwh that's a very old cat. Old age brings many problems to cats, definitely in urination. You should definitely being your cat to the vet and tell them about it to see what you can do. Best of luck..(:
Unfortunately this can come with age We had a 23 year old Persian that passed last year and she did the same for about 6 months before she passed I put puppy pads next to her box for easy cleanup if she had an accident