Bears are individuals, each behaving differently in different circumstances. There are no precise rules about what to do if you encounter a bear, but there are generally effective measures to be followed. Avoid startling a bear. Where sight distance is limited or flowing water is muffling sounds, make noise by talking, singing, shouting, or clapping your hands. Do not make shrill or high pitch noises as these may attract bears.
Some hikers use bells for noise.
Bears are extremely protective of their offspring. Always stay alert to your surroundings. Leave the area and inform a ranger. Avoid thick brush and be watchful when traveling off trail. Bears rest and sleep in day beds, such as a depression next to a log, under the roots of a fallen tree, or in dense brush, or out in a grassy meadow.