My friend leased a beautiful Qh who when she test rode him was a dream to ride. Brought him to her own barn and rode him two or three times just fine. But soon he started doing just what you described, and was also very cranky to saddle up. Found out that he had a very ill fitting saddle which was causing him pain. I dont' know why he did not act up before, as he was in that horrid saddle for a long time. I think it was because his former rider really was aggressive and had him buffaloed, while the new rider was older and somewhat timid. He started to balk and spin and buck and rear.
So, got a new saddle, got him treated for his ulcers, had a chiro check him out, and then started systematically working on the ground with him to build respect in him and confidence in her. Got him correctly shod, as his heels were so low he was in constant pain.
Now, he is retruning to his former self, but he does need a firm hand from the get go, or he takes over.
I would totally recommend doing ground work with this horse (and there is a ton of info on here and videos available online) and checking the fit of his saddle.
I am sure he would have dumped me. I tried to ride my friend's horse, and he dumped me!