The ones I've seen are just a mini firework, fired from the sort of pen launcher that also fires mini flares.
It's a scare tool. Does it work? Depends on the bear I guess. Blackies don't like loud, surprising noises. I guess you could pop one off just to alert bears that there were humans in the area, scaring off all other wildlife as well. Depends on the situation.
At close range, I would prefer bear spray at minimum.