So, besides the bear bags and bear containers. What is the best way to deal with a bear if one wanders into your campsite at night?

I have never had to deal with one yet. . . but I am going deeper into the woods soon, and we had a frost mid-spring that killed all our berries and nuts. Because of the lack of food I have heard reports of bears going places and doing things that they usually do not. Our bears are usually small black bears, but a bear is still a bear.

I have heard of people using whistles, lights, alarms, etc.., but what have ya'll encountered, tried, tested?

Thanks

P.S. I always use a lot of prayer