Depends on the dog, its training, its purpose, the bear, the bear's species and where the bear is located, sparse bear population or crawling with bear. Rural working dogs are trained to "deter" predators by barking, which warns the humans. The dogs can and do chase of wild animals that would kill their herd, if trained to do so. Many dogs are protective of their owner. Whether they would fight to death to protect thier owner or flee depends on training. I do not plan on testing that with my dog. Whether a bear hearing a barking dog would leave or attack is another unknown. Most horse packers take dogs and swear that the dogs deter bears. But, as said previously, these dogs trained as are more than just pets.
My dog is a warning signal, inasmuch as that is a deterant. We trained her NOT to chase animals. The only animal she is allowed to chase is a squirrl or chipmunk. She loves to chase them up trees, just for the fun of it. She has been through a formal rattlesnake avoidance class.
We have had a bear wander near camp and our dog just sat there, staring at the bear, not moving or making a sound. I think this unfamiliar big beast actually scared her. Had she only heard the rustle in the bushes and not seen the bear, I think she would have barked. Had the bear advanced agressively towards us, hard to say if she would have jumped into our arms in fear or growled fiercely.
I really do not see bears as any more threat to my dog then me. We still take her with us. The fact that there are few bear attacks it the first place, makes me think that bear attacks on dogs are just as infrequent. Thus we do not hesitate to take the dog. And yes, when we ran into the black bear, we were in country that also had infrequent sitings of grizzly (very low population).
I laughed at the comment regarding "low maintenance". Our dog got sick and I just cleaned up more than a dozen barffs on my carpet! She takes a swim in the pool, rolls in my garden, and then bounces into the house mudding up everthing (this when my husband is on duty and HE does not clean the house)! I have to use a sleeping bag cover when she backpacks to protect my very expensive sleeping bag from getting dirty. She sheds like crazy. Companion, yes; low maintenance, no! But, in comparison with a 5-year old grandchild we just had for 10 days, she at least does not make me listen to hours of "Sponge Bob riddles and jokes". I love that dogs are non-verbal.