Another handy trick is to start a fire between them and you. Doesn’t work with dogs or moose, but wolves, bears, and coyotes will often be pacified by the fire. With the bears you really have to work to get the fire between you and it, and sometimes it’ll just ignore it… but… better trying than dying?