The St. Albans Science Department put up a video showing what happens when a gummy bear is dropped into a test tube containing molten potassium chlorate (KClO3). The Science Department explains the result like so:

Molten potassium chlorate is a strong oxidizing agent that reacts violently with sugar. Gummy bears have lots of sugar in them.

Here's a similar experiment, which shows a close-up of the poor gummy bear's last moments. It looks hot in there: