Whoever is at the helm of the National Park Service’s socials has a dark sense of humor. While they joke about providing bears a diverse menu while out hiking, NPS goes on to include best practices for staying safe in the backcountry while amongst bears including making noise and carrying bear spray:

NATIONAL PARK SERVICE ADVICE FOR HIKING IN BEAR COUNTRY: 

Hike in groups. Bears like to have options.
Don’t we all? Your safety is your responsibility while hiking in national parks. Planning is an important step in being prepared for any adventure. Although it’s generally safer to hike with a companion, if you prefer to go solo, take a few extra measures, like leaving a trip plan with a trusted friend or family member.
If you’re hiking in bear country alone or with a group, making noise on the trail can alert a bear, or other wildlife, to your presence before you surprise it. Talk to your partners (keep it light, Carol) and occasionally sing loudly. Yell “hello!” You can add in “it’s me” if you’re feelin’ it. You can also clap your hands (if you’re happy and you know it) to let any bears know you’re coming through. Wow. That’s not even on a beat. Doesn’t matter. Moving on.
Bear pepper spray can be an important thing to carry when exploring the back country. It’s used defensively to stop an aggressive, charging, or attacking bear. Bear pepper spray and human pepper spray are not the same. Also, it’s not like bug spray or intended to spice up your campfire meal. That’s a spicy meatball. Always check park rules and regulations to see if bear pepper spray is recommended or allowed for the activities you have planned.
In conclusion, have fun, be safe, and hike smart. MORE INFO HERE