If I encounter a bear on the trail, what should I do?
That's easy... Don't!

Seriously, that has happened to me a few times, relax, "be nice" and follow these suggestions. Also, when you get to the park, talk to the rangers, they know all of the tricks of the trade!