I don’t think there is a “right” answer for all situations, in terms of how close to allow a bear to approach. In bear viewing areas, sow brown bears not uncommonly “park” their cubs just feet from bear viewers, while they fish for salmon, because they feel the babies are less likely to be bothered by a boar bear. In a part of Alaska where bears don’t commonly see people, I had a sow and two adult cubs approach me from 400 yards across the tundra while I was packing caribou meat, and I fired a warning shot with a rifle at 50 yards. A few summers back, I had a grizzly chase our bird dog from 200 yards, come over a rise see us and skid to a stop at 15 yards. I didn’t fire a warning or stopping shot because the bear clearly realized it was time to beat feet when he saw us. On Kodiak, I had a bear steadily approach me from 200 yards, stop at 15 yards, and then began charging at which point I shot it. Each of these situations was different.
My issue with bear spray is I don’t know how to let the bear get close enough to spray, and still be in a position to use a firearm. If I put someone out in front with spray, they could end up between me and the bear. I think spray is a really good option for someone without a firearm and firearm skill. I would be more inclined to shoot the bear with a rubber slug than use spray, because I can be ready with a Brenneke if the rubber slug doesn’t work.