Can't Beat Terran Mech

I'm having a lot of trouble with Terrans who go mech. When they go super greedy and take mega fast third and fourth bases defended with planetaries, there is just nothing I can do. 

When they start to get that super unbeatable composition with tanks, hellbats, ghosts, viking, and maybe some widow mines mixed in, I don't know how to respond. I've tried some stuff in the unit tester, and while I was able to beat the army sometimes when it's cost for cost, but if I make the Terran maxed, there just doesn't seem like there's any way to win. Mech armies are just way too supply efficient. Ghosts just wreck my templar, immortals get emp'd, hellbats roast the zealots, vikings annihilate the colossi, widow mines evaporate void rays, and tanks take care of the rest. And don't even suggest tempests, 10 ravens and all they are are just worthless blimps.

Some people might suggest warp prism harass, but that just isn't possible when sensor towers cover the entire map. With multiple planataries at every base there is no way to counter attack. 

I am really lost, and i need some tips. 

I suppose its a good idea to say that I'm in diamond league.