Kitty might be trying to tell you something. My cat once did the same thing, while I was in the bed! After screaming, hopping out of bed, and quickly stripping the bedding off, I went to inspect her litter tray. It was overflowing (my son is supposed to scoop it out every day, but "forgot" for a few days while I was out of town). Luckily, kitty only peed on my duvet, which I was able to wash and deodorize.
My son got dressed down for not cleaning the tray. My husband got dressed down for not following up to be sure my son was doing his chores. Kitty didn't get a dressing down as she was trying to communicate with me the only way she knew how.
If the tray isn't clean to your cat's satisfaction, then the problem is easily remedied. However; if kitty pees on the bed even though the tray is clean, consider taking her to see the vet. Peeing in inappropriate places could be attributed to an infection of the urinary tract, bladder, or kidneys (if you're a cat. If you're a human, it's probably due to a combination of too many pints and a lack of home training). Your veterinarian can prescribe antibiotics to clear up the infection and advise you on making changes to kitty's diet.
Luck for you, and good health for your cat!
