I explored the possibilities and found hospital beds which have built-in safety rails and various styles of bed rails that can work with conventional beds. These choices looked like they would work, but they were expensive - $160 plus for the rails and much more for new and used hospital beds. This seemed like a major investment for a need that hadn't been clarified and might be temporary.
For the short term, I have constructed bed rails from materials found at a local home improvement store at a cost of about $60. (See photo below) These rails are made from 1 inch PVC pipe and with cemented joints. They are attached to posts of the bed frame by U-bolts, the rough ends of which are capped with plastic caps to protect Mama from scrapes and scratches. They provide just enough of a barrier and reminder to prevent Mama's getting out of bed without assistance. Coupled with a good quality audio monitor, the rails create a system that gives me some warning that she's awake and ready to get up.
The rails could also be constructed as a stand-alone, four-sided structure that is entirely external to the bed. They are not recommended for really strong, aggressive people who could possibly stress them beyond their breaking point. More construction details can be provided upon request.
Do-it-Yourself Bedrails