Bunker Basics
A Bunker is a small structure with a modest build cost. Each Bunker can hold four Terran infantry units -- Marines, Firebats, Ghosts, Medics or SCVs. While inside the Bunker, units with weapons can fire but cannot be fired upon; nobody in the Bunker will take damage until the Bunker itself is destroyed. Units without ranged weapons, such as like SCVs or Medics, can enter the Bunker for protection but will remain passive.
Destruction
When a Bunker is destroyed, the units inside appear in the rubble and can be attacked directly. Units do not suffer any health loss for being inside a Bunker when it's destroyed, but can quickly be overrun without the protection of the structure. Having an SCV or two on hand to repair a Bunker that's under attack will greatly improve the chances of survival of both the structure and its occupants.
Bunker Controls
Select a unit and right-click on a Bunker to order the unit to enter the structure; select a Bunker and left-click on the wireframe image of one of the units inside to order it to exit. Units in Bunkers cannot be given attack orders; they fire on anything that comes within range, prioritizing targets that are actually attacking the structure.
Counters
Terran bases with multiple Bunkers and repairing SCVs can be difficult to attack with conventional units, but siege weapons -- anything with a longer firing range than the units in the Bunker -- can take advantage of the defenders' immobility by destroying the Bunker from long range without giving its occupants a chance to fire back. Terran Siege Tanks, Zerg Guardians and Protoss Carriers or Reavers are all effective Bunker-busters; effects that damage or disable buildings, suc as the Protoss Corsair's Disruption Web or the Zerg Defiler's Plague, are also very useful.