Black Bears that we have in MN tend to be shy. If you accidentally come up on one you will have a second to pull out the bear spray and use it. If you do the bear will leave.
Of course the best bet is to make enough noise you don't accidentally come up on the bear but, I could see how it could happen. I don't make a lot of noise as I hike. Accidents can happen.
That being said, usually standing as tall as possible, putting up your arms, and making a blood curing scream will scare them away too. I would have no problem with that last part. If I ever saw a bear if would happen naturally. I would probably "mark my territory" at the same time.
Grizzly bears are a whole different kettle of fish. If you are cooking a kettle of fish around them and they want it,, just give it to them.