I make sure when I come home from work after 10 pm that I make a lot of noise and get a flashlight. They'll only confront if you get between them and the cubs and for food of course. I find the best deterrent is noise. gives them a heads up your coming!
I remember reading that (i.e., make noise so you don't surprise a bear, who will surely charge if caught off guard) somewhere.
My former sister-in-law said she and her husband were hiking in Montana and are always sure to make lots of noise as they go. It worked in their favor when they came across a grizzly sow and her cubs, who meandered off when they heard them coming. (Whew!)