5 Answers
5

Have an observer in front of your army when engaging the enemy or crossing the map.

When you notice your opponent has them cluttered around the map, at least as Protoss it's quite safe to send an observer around. Once you spot one, just send a single stalker over. Widow mines have very limited range.

When your opponent has them in his army composition and you see them burrowing as you engage, it might be too late too run all of your units away. At this point, I think it's always best to send a single unit right towards the widow mines, as they always attack the nearest unit.
This also works great when you don't have detection yet and a widow mine is inside your mineral line.

If you're fast enough, split your army.

As Zerg, its much harder to avoid taking too much damage from widow mines and you have to be much more cautious with your overseers. Two hits from a widow mine, and your overseer is gone.

125 Damage with 40 splash means 1 hit kills against quite a few units, even Mutalisks.

Fast and cheap. If deployed early, the terran player can get decent map awareness in place.

Great for choke point play, especially with the splash damage.

First, lets mitigate the strengths:

Use units with high hp, preferably 200+. Even a ball with units with 120 hp can be wiped out with three mines' splash damage, if clumped together enough!

Retain map awareness. This should be done anyway, but it's much more important against mines. Mines can't attack if not burrowed, so moving it across the map to plant leaves it very vulnerable. If you have a handful of units observing the map, these mines can easily be taken out before the plant.

Send a single scout through chokes points first, with your main ball out of visual range. This will a) tell you if there are mines placed or not. b) If there are, your ball can't be seen by the mine, so you don't reveal too much info to your opponent. If you do have to go through the choke, we'll deal with the mine by:

Exploiting its weaknesses:

If Drilling Claws has not been researched yet, as typical in early game, the mines take 3 seconds to burrow. That is an eternity in game terms! Kill it with fire before it gets a change to do damage by focus firing it.

If you do come across one that has been burrowed, keep out of its range. The mines' firing range is 5 game units, compared to 6 of the Stalker, Marauder, and upgraded Hydra.

The mine takes 1.5 sec to fire, so fast units can just walk past.

Once the mines has fired, it has a reload time of 1.5 sec, creating a nice gap for other fast units to pop through. This is tedious, though, so:

Use a ball of high HP units with low Hp units coming through in the 1.5 sec gaps. The high hp units can draw the fire, just keep the low HP units out of the splash damage zone.

This covers all the min/max type thinking against mines. The basic strategy is to use detection of some kind (Raven/Detector/Overseer) in front of your army, but moving it slowly in danger zone so as to not draw all the fire. (Except for the invisible Detector, of course). With the mine revealed, use longer range units like those mentioned before to snipe the mine. Remember that the units attacking the mine will be revealed, so be midful of giving away your composition by killing mines.

Sources:
- My own hopes and fears every time I play and use mines. And liquipedia as linked. I would've linked more, but apparently I need more rep for that. Aboo. :/

As Protoss you need to get one or more observers.
One with your main army, and one in your base, to defend drops.
The one with your main army should always move infront of you.
Altertivly have a Zealot move infront of your army to trigger the mine.
Stalkers can easliy snipe them when observed.

For Zerg you need an Overseer.
Pretty easy to make and costeffective!
Just get a few, and scout ahead. As Zerg, you can easily sent a few Zerglings ahead of an attack to trigger the mines.

As for Terran (its take two Mines splash damage to kill an SCV, and one mines splash to kill a probe or drone)
But have a turret ready in your mineralline if you scout a double gas.
Otherwice your good with scans and a Raven.

The main point is: don't be scared. Get 4 queens, 3 bases, and either a lot of lings or roaches. Both don't suffer too much from widow mines and can easily avoid their attacks.

as usually, scouting is a key: if opponent moved out with mines - attack his natural/main. If opponent stays defensively - expand (get 3rd, 4th bases).

Some other points:

check the gas mined by opponent with the very first scouting overlord - that will give a tip if you should expect factory/starport at all.

if you see 2 hellions at 6-30 - 7 minute mark that are not followed by 2 other hellions then opponent come for either widow mines or with banshees. That still leave some space to opponent for maneuver, but ...

Reaction on that should be/could be: 4 queens (spread creep and have anti-air), be ready to start lair at 7th minute mark to get detection (overseers at 8th minute mark - when banshees arrive).