There are many other techniques for different heights of incoming force or simply what you want to do with the attacker, but the above one is a fun one to practice and easy to do at full speed with a partner as he will tend to roll out and away pretty cleanly.
Balance is an important factor in any fight. Someone who is running at you will have difficulty correcting for your sudden side movement. Every situation is unique, so there is no one best way to move. If I'm in an L stance, I can pivot on either foot and take a shot at the attacker as he passes. My counter would depend upon the degree of threat. There are also several excellent ways to take down a running attacker by using his momentum against him.
best methods iv ever used is when the opponent rushes you wait for a jab side step and put your arm across the chest or throat with pressure your should be laying back down on the ground have fun if he trys to tackle do a wrestling style sprawl but keep the hands close to your body and as his head goes to slide past your body throw them in to a gilliteen choke hold P.S. sorry about any mispellings
I know there are probably more effective martial tactic, but how about just sticking your jab out and just keeping it pointed at the other guy’s face? It’s hard to just run at a person when there is a fist sticking out. They’ll have to do something to brush it out of the way which should slow them down enough and give you enough opening to throw a counter of some kind. It might be risky against more experienced martial artist, but then again experienced martial artist doesn’t dash attack people.
Move out of the way and either knee them in the face if they go to take you down at the legs, or strike to their face if they're coming in high.
These techniques are actually ones that are regularly practiced by Uechi Ryu brown and black belts via Seisan Bunkai. (Bunkai is the practice of the application of kata techniques with a partner) I'm sure other styles that do Seisen kata also do likewise.
All My life of Fighting wether sparring with a friend, or a bully i never really knew the proper way to defend against a Running Attack or Spear. I want a sure way. (P.S I heard that you should elbow them tot he face but, that seems like if you could fall while doing it.)