Be patient and never shame your cat or punish him for something that is likely a physical or emotional issue. Animals don't do things to purposefully harm or upset people. Punishing your cat will likely be confusing and only make matters worse. In the meantime, clean the soiled area thoroughly with an enzymatic cleaner that neutralizes the smell of cat urine. This can be found in all pet stores and even in some supermarkets.
When your cat starts urinating on your furniture and on the carpets, it's a problem. However, when your cat begins peeing on your bed, it's more than a hassle--it can damage the relationship between you, your cat and/or your mate. Fortunately, there are at least three things you can investigate to determine what may be causing this behavior.
Take your cat to the veterinarian. Cats are creatures of habit. If your cat has always been good about the litter box and has never acted out in this way before, the first thing you need to do is determine if there is a physical problem. Likely causes can be a urinary tract infection or renal failure. This can cause cats to "leak" their urine while sleeping.
Consider spending a little extra time with your cat, particularly if there has been a major change within your household recently. Is there a new baby in the house? A new partner? If you are suddenly sharing your bed with a new person, your cat could be staking a claim to what was previously his alone. Allowing the new member of the house to take over feeding and grooming duties can also help during the adjustment.
Clean the litter box frequently, even daily if need be. This is particularly important if your cat is primarily indoors. If you have the space, two litter boxes can be helpful. Some cats prefer to urinate and defecate in separate places. Cats, like people, appreciate cleanliness in their bathroom. If the litter box is not kept clean, your cat will find somewhere else to go--like your bed.