I agree with the others to get her checked by a doctor and pretty much all the other ideas. While i'm not big on crate training as a general thing, in this type of situation I think it can be very helpful.
The additional thing i'd offer is that there is a "testing period" that most rescues go through in a new home. They exhibit a watered-down version of themselves for the first 2-6 weeks because they don't know how you will react. As they become comfortable with you and see that you are consistent in your love and behavior, they relax and start exhibiting their "normal" behavior. It's at this point that you often start seeing negative behaviors in that wonderful rescue.
On the positive side of that, she feels safe and comfortable with you enough to be herself.
But now you face the difficult task of breaking her of her bad habit. If you are feeding her late in the day, as dturn suggests, feed her earlier. I had a shepherd who had been bred repeatedly and she had accidents in the night - feeding her earlier stopped it immediately. She just didn't have the muscle control after all those litters.
I will also add that since it is just pooping and not peeing that it could be a behavioral issue not a physical issue. Pooping in YOUR bed could be a way of stating her place in the household (especially if there are other animals). A crate or even just a dog bed next to the bed could be enough to stop the behavior. Some dogs just get a bit confused about their place when they sleep on the bed with us - it's not a dominant thing, it's just confusing to them (and puppy mill dogs, backyard breeder dogs, etc., tend to have that confusion more than dogs raised in a more normal setting).