When modern warplanes have missiles fired at them, they deploy flares or chaff to lead those missiles off-target. The magnesium-containing flares are designed to burn hotter than the airplane's exhaust, drawing heat-seeking missiles to the flare rather than the plane. Meanwhile the reflectiveness of chaff—typically small pieces of aluminum or reflective plastic—are meant to dazzle and confuse radar-guided missiles. This overly dramatic video of a Eurofighter Typhoon shows you how it's supposed to work (at least with flares):
And while there's nothing pretty about what's going on in Syria right now, I found this footage of the AC-130 gunship activating its ACDS (Airborne Countermeasures Dispenser System) almost perversely beautiful.
As you can see there it's dispensing the flares sideways. But there's another, more dense firing configuration they use that sends a third trail directly aft—the so-called "angel wing flare" pattern, whose name you'll better understand after you see the resultant smoke pattern:
With the way things are going in terms of global terrorism, I can't help but wonder if we'll one day see civilian aircraft equipped with ACDS.