A cold shiver goes up most players spines when they hear the phrase "Nuclear launch detected", and it was not on his or her team. The reality is, you have a matter of seconds to find the glowing red dot and the ghost it's attached to before it decimates a significant portion of your base and possibly your mineral flow. This means getting in and out quickly and doing what you need to do before it drops! Here are my best tips for countering the Starcraft 2 nuke strategy.
Starcraft 2 Nuke Strategy Counter 1: Terran
With Terran, you have the good fortune of detection from a building that can be toggled and used any time you need it. So if you suspect he is targeting your mineral line, evacuate it and run a scan on the surrounding area to see if you can find the ghost anywhere around. It should be pretty obvious what to do once you've scanned him out.
Starcraft 2 Nuke Strategy Counter 2: Zerg
Zerg need to be carefully managed since detection is not as easy as it was in the original Starcraft. Keep at least one or two overseers and spine crawlers laid out around the edges of your base to detect dangerous cloaked units like a ghost. Once the nuke drops, have a group of speedlings and hydras patrol the area while evacuating drones to a safe location until you can find the ghost.
Starcraft 2 Nuke Strategy Counter 3: Protoss
Protoss are smart enough to have a unit devoted strictly to decloaking enemy units, the observer, and it works marvelously. Keep one or two in your base at all times, even if you have photon cannons, simply because you cannot trust your enemy to move right for this area where photon cannons will see him. Have some fast infantry or air units patrol with the observer until the ghost is revealed and taken out!