It sounds like 1) either she was in pain 2) she had reached her timespan of focus; and because you kept pushing her, in her mind, bucking was the only thing left to do, to get you to stop.
If she hasn't been checked out by a vet in a while, I would suggest the stable mgr do so; she may have something wrong with her. I'm assuming you were given this horse to work with, because of this 'spazzing out' issue?
If she checks out fine, then you need to start reading her body language, and perhaps you will need to anticipate when the blowup may come, and end your lesson (riding part) BEFORE the explosion comes. Riding out the bucks is well and good, but if she still winds up bucking every time you ride, where is that getting you? She's still bucking, so you're not fixing anything. So if she is giving you any kind of subtle hints that she is reaching the end of her 'focus' time, such as chomping the bit, anxiousness, swishing tails, pinning ears, or an ear, getting tense in the neck, starting to drive on the front end...etc...when those 'cues' from her, start coming, you need to calmly stop, and get off, and give her a break; maybe do some ground exercises for a while, to refresh her mind, then get back on for a few moments, so you can end on a relaxed note; don't push her till she blows up...
If she's not giving 'cues' or signs of blowing up, then maybe do 5 minutes on her, 5 minutes off, gradually working up to more time in the saddle; always end when she is relaxed under saddle, even if you've only walked or trotted a bit.
"The ideal horseman has the courage of a lion, the patience of a saint, and the hands of a woman..."