Okay not that I am a Physics expert or even that physics should be involved with Manga, but people keep bringing this up so I am going to say what I want (this is what I thought happened)!!
Fire is just a visual representation of heat and heat (in its basic form) is just rapid movement of atoms (or something like that) so in essence fire (without anything to burn it on) is just heated air (or gas).
For those who think it is just energy, the only form of energy that can exist without form is light cuz of its dual nature, every other energy must have some form of mass to support it. So Ace is heated air!!
Magma is heated solids (that have become liquid) with mass. Magma (if its hotter then fire, IDK) when coming in contact with a body with lower temperature (i.e. Ace) will transfer its heat (there is a law or something like that IDK) and the transfer will keep taking place until an equilibrium is reached. Which means Akainu will keep heeting up Ace until he is at the temperature of Magma.
Note that this whole time the motion of Ace's atoms have been increasing (that is what heat is) and when atoms move fast enough, they break apart (from each other, nothing "nuclear" going on here) well he has gone far above what he is capable of hence he takes damage!!
Okay if anyone agrees with all this, I will be very surprised.
Sorry. I prefer simpler theories.