With my normal buddy, we have a procedure that if they ever have an gas failure at depth (we refuse to ever simply "run out"), the diver with the problem will go on the other's back gas at least at first. If it's a problem that can be corrected immediately, we may be able to continue the dive. If it is not correctable immediately, we can put one or the other of us on the pony for the ascent, if we so choose.
By having two second stages each, in addition to the pony I always carry, we have much more gas available in any case we may need it. Additionally, if an incident were to happen on the first dive of a series for which we were away from any potential refilling (such as having an LP hose or yoke face O-ring blow on the first dive of a two-tank boat trip), we could make the ascent sharing back gas. That would allow us to correct the problem on the surface interval and still have the pony available as redundancy for the following dive. If we went on the pony on the first dive, there may be no way to fill it (adequately) for the second dive, which would adversely impact my available redundancy options.