Bear spray is apparently the most effective against bears. I've read guns are about 40's % effective and bear spray is 90 (something) % effective. Unless you have a hip holster, you most likely will have to store a gun somewhere on the bike. Then again maybe those that have guns sleep with them under their pillows. But if you're in column A, and a bear is attacking, perhaps if you ask nicely it will pause while you fumble around for your key to the top box and then look for your weapon.
So say you finally get the gun out and the bear resumes its charge, and lets just say for arguments sake that you are able to get a shot off, I assume you know exactly where to aim and that under such duress, you actually manage to aim at the most effective spot to kill a charging bear. In all likelihood, you'll just piss off an already angry animal. Good luck with this btw!
So just for the record you think that if I camped out at your house without permission and you decided to get all pissy about it, you think it's ok if I shoot you? Seriosuly, you're in the bears back yard - give it a little respect.
In reality, you are most likely to be injured getting to the campsite on a motorcycle than you are to be attacked by a bear. Most campers that have been attacked, have either surprised the bear when hiking around coming from down wind withouth making any sound - startling a 500lb bear is never a good idea btw, or they have left food out without properly storing it. Bears want nothing to do with people.
Personally I bring bear spray when travelling to a known bear area and I hang a bear bag or use something like an Opsak to store my food in. The more lethal threat in my experience has been the local mosquito. Seriously, there is an infinite supply of them, they are not afraid of people and have been know to kill - just sayin!