I'd say the hiker should go buy a lottery ticket.
Had he run, the cougar might have gone into pursuit/hunt mode and took him down. Under the circumstances, other than perhaps chucking rocks or arming himself with stick or something, he was short on options.
He's d@mn lucky he spotted it before it was on him.
I recall a story awhile back, a fellow was out hunting in our region. For some reason, he decided to look behind him (instinct? intuition? luck?). He found himself staring at cougar a few feet away. He was able to basically 'hip shoot' it with his rifle and survived.
Mother nature can be dangerous. Even on short hikes, I usually have at least some form of fixed blade.
Boss