Spray an aerosol lubricant. The spray must be pushed into the tire right at the spot where the rubber has come apart from the rim. Distribute the lubricant around nicely by spinning the tire around as you spray the stuff.
Now, the lubricant spray can be ignited using a simple lighter. Once you have a flame, place it near the bead itself. The tire is rapidly re-inflated and expanded, which makes it jump onto the bead on the wheel rather quickly.
At this point, the tire is cooling down very fast, and you have to rush to inflate the tire using an air pump. Make sure it is seated properly on the wheel.
And that is it. You have quickly set the tire back and sorted out the flat tire. Make sure you have a fire extinguisher around and either protective eyewear or gloves. Use extreme caution while dealing with anything flammable like this.
Using heat in this way to repair flat tires only works if the flat tire is of a certain sort.