In addition to setting up your tanks in better positions, you can also try,
Siege Tanks + Floating Barracks
Siege tanks have a longer firing range than sight range, which means if you see the enemy tanks before they see yours, you can get off the first volley and that often makes the difference.
Siege up your tanks (preferably on high ground) and then float a barracks far in front to give your tanks more range.
Spider Mines are essentially free. Place them on the path of the enemy tanks. Plus the computer won't scan when it walks to your base.
Placing mines are a bit tricky. You'll notice that if you select 12 vultures and tell them to all place a mine in a single spot, only 1 mine will be placed by 1 vulture. You need to manually split the vultures and spread the mines.
For an example of killer spider mine placement, check out Boxer's Minetrap from 2005 Season 1 Starleague Finals
Higher resolution video of Boxer placing mines
A dozen cloaked wraiths will quickly snipe tanks.
This takes a bit more micro because first you'll have to kill off the marines or goliaths that a computer usually sends along, and then pick off the retreating tanks.
Or you can dodge in and try to pick off the tanks. The computer will scan. Dodge out just as the scan is going down to minimize the damage that is taken. Wait for the vision from the scan to wear off. Dive back in. Repeat.
Drop Goliaths On Top of Tanks
This is how the pros take care of siege lines.
- Load up two dropships with goliaths and fly them over the enemy siege tanks.
- When the dropships are over the enemy tanks hit U and then click each dropship to unload them while they're still moving. This is really important because it'll unload units almost a full second faster.
- Move in your additional ground troops to attack the distracted tanks.