You can buy at an office store this plastic matting for use under office chairs, to protect carpet. It's got little spikes on the back of it to keep it in place on the rug. Get it cut to the length of your bed and lay it under there... in my experience neither cats nor dogs like the feel of the little plastic spikes digging into their toes, and they will learn to avoid it. The stuff is fairly cheap here... maybe $1.50 per foot?