In low numbers turrets at your bases will do, then you'll need marines support, and if they get a large number of them you'll need to suicide a raven or 2 into them.
Vikings are semi ok at taking pot shots or sniping them as long as you have somewhere safe to fallback to.
*Just played a 2v2 Random to get a feel for my mouse and it was a good player paired up with a super turtling Terran (Made a supply wall 3 depots think, 4 bunkers and 6 tanks in his main with 3 turrets and 2 sensory towers. Hilarious.
After we beat the competent Toss, he actually counter attacked but I set up a nice dual pincer attack with my seiged tanks in the back, scan giving me sight + range, then pushing up the otherside with my tanks / marines.
We sniped his PF expo then I sieged up around his main containing him.
Partner said 'If you nuke him I'll give you a cookie'
Nukes it was.
4 ghost acads go down, 4 nukes go up, 4 nukes go down.
Turns out the other partner stayed in game for another 20 minutes :lol
Even though his Turtle Terran buddy got nuked "you are my hero".
I'm surprised how fast and accessible nukes are. I'll be sure to try to use them in longer games.