KINGS CANYON NATIONAL PARK (KPIX 5) — A Bay Area man’s quick thinking when he encountered a black bear in the Sierra may have averted an attack.

Kevin Burton, CEO of the San Francisco software company Spinner, said he was hiking Kings Canyon National Park two weeks ago when he crossed paths with a black bear. Burton captured the encounter with the camera on his phone.

READ MORE: Debate Intensifies Over Reopening JFK Drive in Golden Gate Park to Auto Traffic

Within seconds of spotting the bear, Burton, an avid backpacker who has encountered at least a dozen bears, knew exactly what to do.

“With a black bear, you kind of want to intimidate them,” Burton told KPIX 5. “I wanted to assert that I was in control of the situation.”

In the video, which was posted to YouTube, Burton can be heard announcing himself to the bear by yelling, “Hey, bear!” When the bear retreats, Burton is heard shouting “Good boy!” Burton said he also knew to make himself appear larger than he is.

READ MORE: San Jose Congregation Holds Fast Following Racist Easter Zoom-Bombing

Black bears are known for being timid, and this bear made his way around Burton rather than confronting him.

“I wasn’t that scared,” Burton said. “I thought it was cool. The great thing about the wilderness are those moments.”

Burton stressed that running into a grizzly bear would have been an entirely different experience. Grizzlies will charge if intimidated, so Burton warned that in grizzly country, it is wise to carry bear spray.

Raw Video: Hiker’s Bear Encounter At Kings Canyon

MORE NEWS: Hero Police Dog Saves Fresno Officer's Life Despite Being Stabbed 6 Times

(Copyright 2013 by CBS San Francisco. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)