The standard approach is "octopus donation" in which the buddy offers the secondary "octopus" demand valve to the diver in trouble, although this is not universal. A variation on this approach is for the buddy to offer their primary demand valve to the diver in trouble, while switching to the octopus. The reasoning is that this is more likely to calm a diver in trouble, and the gas will be appropriate for the depth.
