Hi Chris and Natasha,
When a cat starts eliminating inappropriately, it's either due to a medical reason like a urinary tract infection, crystals (tiny particles which develop in urine that is not pH balanced--it's not acidic enough), or the cause is behavioral .
First, you have to rule out the medical reason, so your cat needs to see the vet as soon as possible for a definite diagnosis and treatment, if necessary. Antibiotics will be prescribed for a urinary infection and dietary changes and/or nutritional supplements to acidify the urine will be suggested. In male cats especially, a urinary infection and/or possible obstruction from the accumulation of crystals, is a medical emergency. I realize this is the first time your cat did this, but if you catch a urinary infection at the beginning, it shouldn't turn into a blockage, which is life-threatening in a male cat, due to his very narrow urethra.
If a cat experiences pain upon urination or defecation, he will come to associate the PLACE of eliminating--the litterbox itself--with that pain, and then choose to eliminate ANYWHERE else. Cats in this situation (with infections) usually choose 'soft' materials to go on, thinking this will avoid the pain. Carpet, throw rugs, bathmats, clothing, backpacks, sofas and beds are usual favorite places.
In order to prevent your cat from returning to the places he's already soiled (if he smells it, he'll keep thinking they are appropriate toileting places), you can use an enzymatic cleaner to completely remove all traces of stain and odor. Nature's Miracle and Zero Odor are good products for this purpose, and can be found in Petsmart/Petco, most pet supply stores, and online. For more info and to view all related products (Nature's Miracle makes a laundry detergent for you linens), please see:
Cats can also sometimes start eliminating inappropriately if there has been any kind of change in their lives or environment, as this causes stress and anxiety. If the reason for eliminating outside the litterbox is NOT found to be medical, it would have to be treated as behavioral.
Cats are creatures of habit and do not take kindly to change. If you have had any new people added to your household, or if a 'usual' person has left, if you got new furniture, changed the configuration of your furniture, installed new carpet, added new appliances, another animal, etc., or if your usual daily hours at home and/or away from home have changed or you've gone on vacation recently, any of these situations could cause your kitty stress.
Feliway is a cat appeasing pheromone which can help to calm stressed cats and curb urine marking and/or inappropriate elimination. It comes in both a spray and plug-in diffuser form. The diffuser plugs into an electrical outlet like an air freshener, but has no scent to humans.
For more information, please see:
Major pet supply stores like Petco/Petsmart carry Feliway, you can also order it online, and some vet offices carry it.
There's another product which I think may help you get your kitty back to using the litterbox--it's a clumping kitty litter called 'Cat Attract'--it contains herbal attractants which encourage use of the litterbox. It too, may be found in major pet supply stores.
You should have more than one litterbox, if you don't, already. Some cats prefer to urinate in one box and defecate in another. The rule of thumb is usually one box per cat, plus one. If you have a multi-story house, a box on each level is also appropriate and usually prevents accidents. Keep all boxes immaculately clean at all times.
Keep in mind that first you should take your cat to the vet to determine if the cause of urinating and defecating on your bed has a medical basis.
I hope all goes well, and this problem is resolved very soon!