This is a really simple algorithm that's been around forever in the demoscene. You can do fun things like make an arbitrary shape be the source of the flames. Here's a nice article from (the long missed) flipcode on how the effect works:
http://www.flipcode.com/archives/The_Art_of_Demomaking-Issue...