It's very important to understand the difference between defensive bears and those with other motives because your responses will be different from this point on. A defensive bear is a stressed bear. You have entered its personal space and the bear perceives you as a threat. The bear may retreat, or remain nearby, nervous and uncertain. This may be difficult.
Most charges stop short.
Try to appear non-threatening. Talk to the bear in a firm voice. This may calm the bear as well as yourself. Do not shout or throw anything at a bear acting defensively. It may provoke an attack.