How old is your dog? Is he/she otherwise fully housebroken or still learning? Doe the dog sleep in your bed at night? When does the dog pee in your bed? Do you have other dogs? If so, where do they sleep?
It sounds like a dominance issue, but there could be other factors at work.