Many black bears and grizzly bears can climb trees, especially if they see a person climbing a tree to get away from them. The most common bears that climb trees are female bears who think humans are a threat to their young.
According to BearSmart, black bears are more courageous in trees and may purposely chase a person up a tree. They typically kill their opponents by throwing them out of the tree.
If a person meets a bear in the wild, the best way to escape is to carry bear pepper spray, make a lot of noise and travel in large groups.