In this neck of the woods, a shotgun tends to be the preferred option since its less costly than a suitable rifle. In addition to the cost factor, less lethal ammo, like cracker shells and rubber slugs, are available for the smooth bore, where only lethal ammo is available to the rifleman.
Buying a gun though is not the end of the story. Should you find yourself in circumstances where you need to shoot, you need to acquire several other skill sets, including practical field marksmanship, which differs from shooting at the range, gun handling under stress, and a working knowledge of bear behavior and physiology. A lack of knowledge or ability in any of the forementioned areas will result in a potential disaster the first time you think you have a problem. You might kill, or worse, wound a bear that didn't pose any danger to you, in your excitement, you might not be able to run the gun, or if you shoot, you might choose a killing shot, rather than a stopping shot. So the first step is education.
Pick up the books on bear attacks by Garry Shelton (3) and Stephen Herrero (1). Purchase a repeating shotgun that has sights you can see, an action you can manipulate, and a trigger you can manage. The gun should be robust, fast handling, and light enough that you don't find it a chore to carry even when fatigued. Practice loading, unloading without running the ammo through the chamber, practice she'll select drills, and work on fast target acquisition. These can be done at home with snap caps, while at the range you can hone your marksmanship skills with attention to rapid target acquisition, and rapidly firing a pair of shots without taking the gun off your shoulder. If you intend to carry cracker shells, shoot them enough so that you are sure not to launch them past the bear and drive it towards you. Be aware that these things pose a significant fire hazard.
Edited to add . . .
One of Shelton's books has an excellent section on how to use pepper spray. IMHO, pepper spray can be useful in some circumstances, but it does not replace a firearm. You would ot want to use pepper spray in an enclosed space like a tent or a cabin if a bear intruded. If you drive off a bear with pepper spray and it returns, you can't reload the cannister, but you can reload your gun.
This will get you started.