That's the biggest problem with bears. A sow with cubs. You were lucky.
If i'm not hunting I try to make a lot of noise so they know i'm coming.
When i'm hunting i'm a still hunter, so i'm moving slow and quiet. exactly what we're not suppose to do in bear country. I've been lucky to not surprise any bears.