I had a mare like that she was given to me, I took her on as a project. She reared, spun, bolted, had a seriously bad attitude, serious temper tantrums, when one thing did not work she tried something else. She was very clever. She was 12 years old when I got her. What I did is completely restarted her like she was a colt that was just getting started and knew nothing.
What I discovered is she was very insecure and had no confidence as she had not had a leader and had been allowed to get away her horrible behavior and it just escalated. It took about 6 weeks of serious work and lots of time spent at her thinking tree before I dared even climb on her back. Once she realized I was not backing down, I was not going to hurt her, and I was going to keep her safe she did a 180 degree transformation she became a pleasure to be around, ride and I trusted her to not kill me.
I recommend starting her from scratch like you would a colt in a round pen, gain her trust and confidence. Do lots of interesting things that she is comfortable with. I love using obstacles it gets them paying attention to you and keeps them thinking. As her confidence builds then ask for a little more, but don't push her to the point of exploding always give her a way to find the right answer and reward the slightest try. Right now she does not trust you to keep her safe on the trail or away from the herd, build the trust in place she is comfortable. Once a horse stops thinking and starts reacting it can get ugly really fast as you have discovered. If you do not have the knowledge or skill then have her sent to a trainer.