They knew the bear was there and ran.
From the cited story: "They encountered a black bear, which began to follow them, //snip//
The friends told the police they scrambled to get away from the bear, all running in different directions."
I suspect that acting together, they could have scared the bear off by making lots of noise, standing together and throwing things at the bear.
I'm fairly confident that when the bear saw them run and split up, (as a group of deer might) his predatory instincts cut in.
Yep, with canines it's called
Prey Drive, it's probably similar with bears. You run, you look much more like something that needs to be chased/run down and possibly killed/eaten (depending on type of carnivore doing the chase). Stand your ground and throw rocks or hit them with pepper spray and you appear much less appealing. FWIW, possibly not much...