Soaking in warm water with dissolved Epsom salt has been a prescribed therapy for swelling and pain since the 17th century. There are no peer reviewed articles demonstrating how Epsom salt, or magnesium sulfate, might alleviate discomfort, but there are at least two theoretical mechanisms. Magnesium could be diffusing through the skin and causing a decrease of inflammation. The salt bath could also make the heat transfer between water and skin more efficient.
Magnesium as Mediator
Magnesium is involved in controlling inflammation. When the concentration of magnesium outside of cells increases, inflammation decreases due to an increase in enzyme activity. Unpublished results from a researcher at the University of Birmingham reports that in a hot bath, magnesium ions from Epsom salt are able to diffuse through the skin barrier. In the elevated temperatures of bath water, the magnesium ions could theoretically be entering the extracellular space of inflamed tissue and mediating enzyme activity. (ref #1 and ref #2)
Improved Heat Transfer
The presence of Epsom salt in water increases the liquid's density and changes its wetting properties. In a heated bath, the heat is transferred through an exchange of kinetic energy from liquid to skin. An increase in density means there are more molecules in a given area to transfer that energy. A change in wetting properties means that the liquid makes better contact with the oily surface of skin. It has been speculated that these changes could increase the efficiency of heat transfer in a beneficial manner. (ref #3)