The best choice is going to be a concave mattress. Or one can use bed wedges to get the same elevated effect.
If one cannot afford these, the normal mattress that is being used should be of quality and heavy, so there is no gap between the rails and mattress which is the main reason for accidents and falls.