Hellbore-
You asked about bear spray. Published results vary WIDELY, and many say that the bear either ignored it or was infuriated by it.(I study attacks by dangerous animals extensively, and have books on the subject.) Incidentally, there was another fatal alligator attack in Florida about a week ago. I think 'gators and black bears can be handled by the same handguns.
In AZ, I think I'd carry a .357 or .44 Magnum with four to six-inch barrel, and a load likely to give ample penetration. I'd use my S&W M66 or Ruger GP-100, with Remington's 165-grain load, or Speer's 158-grain Gold Dot. (If I still owned a .44 Magnum, it would be ideal, but for hiking, the lighter .357 and its more compact ammo would be preferable.)
I do know of a case in which a Wyoming game warden was down and being chewed on by a grizzly. He drew his "issue" M-66 loaded with unspecified 158-grain JHP rounds, and killed the bear, I think with a neck or heart shot. Actually, witnesses said he panicked, and that only one shot struck a vital zone. He sprayed the whole six shots. I hope your nerves are better. In any event, black bears are smaller....
STUDY BEAR ANATOMY at the zoo, or in a museum and in books. You want to know instinctively where to aim.
For a rifle, I suggest Ruger's M-77 in the short International version in either 7mm-08 or .308. If you shoot a handgun well, and the gun is only for close range emergencies, and weight and bulk are at a premium, I'd use the .357 revolver. It will also (with .38 ammo) harvest small game for the pot while on the trail. Of course, it will easily kill snakes, and you may encounter some of the nastiest, including the Mojave ratttler. (Which see, on the Net or in the library/bookstore.) Scientific name is Crotalus scutulatus scutulatus.
Lone Star