Ok - i'm going to answer your question. But before i do, i'm going to give you some really good advice.
The fact you have to ask this suggests you're too new at this to be taking a firearm into a hostile situation with a bear without a little training. Seriously - firearms are great tools for bear defense, but your head is your number one defense, and unless you've got some experience with bears, or have a lot of experience shooting your gun in a situation similar to what you'll face with a bear, you're probably better off with pepper spray and a big stick.
Get someone to teach you a little before you do it. Seriously. There's ways to train, but if you're not a bit of an old hand at it you can get in over your head real fast.
Ok. Having said that - not only do i take a gun on a hike, really i'm often just hiking to get out in the woods with my guns
Any crown land not specifically forbidding guns (like a national park or something) that isn't part of a municipality is generally ok. You can find no-shooting areas and more information in the regular synopsis. Check it out for the area you're thinking of.
You do need your pal of course (c'mon dude - you've got a gun. You need license and certs with you, always. You should know that).
It's also good to take your hunting license with you. If an officer stops you you don't want him to think you're a poacher. Shouldn't be a problem given your circumstance.
Don't do anything crazy like hike around with a bunch of women with one in the chamber or anything.