What Hedgiemama said. I've had horses since 1986 and rode for about 8 years before that. (ok, now I'm admitting my age
) Crops, dressage whips, lunge whips, buggy whips...all have their place and proper use.
Some never even touch the horse eg. a lunge whip is cracked to encourage forward movement while lunging (working a horse in a circle on a long line) and just changing body position and the position of the lunge whip is also a signal to the horse to reverse. Some just lightly touch the horse to signal a specific cue (ie. dressage)
None should ever be used to go out and punish a horse and teach him/her who's boss as you've described.
ETA: a charging horse is dangerous and does need a lesson in manners, but not that way. If a whip were to be involved is should be already in hand, prepared to be used if the horse is acting dangerously. It would have to be applied immediately to be connected to the undesirable behaviour and should be a quick correction, not used in anger after the fact. The truth is, most newbie horse owners do not have the experience to deal with that kind of behaviour and should be seeking help if the horse is dangerous.