When frying an egg, I drop about a tablespoon of room temperature butter in the frying pan and turn it on medium flame. As it's melting, it starts to make a hissing sound, and bubbles a bit. Then, I take the pan and give it a shake, spreading the butter around the pan - and the hissing stops, even after putting the pan back on the heat. What's going on?
The hissing and bubbles are due to the butter's water content turning into vapor. It stops when there's no more water and only fat/milk solids remain on the pan. When you shake the pan you help release the last few water/vapor droplets into the atmosphere, thus speeding the process.
@Vida R is correct, it is moisture boiling off.
The surface of you pan is obviously hotter than 212°F (100°C). At that temperature, the entrapped water turns to steam (hissing), the fat transitions from a solid to a liquid.
Here's a chart showing the fat, moisture and solids content of various butters (from here).
At a constant volume, increasing the temperature of a gas yields an increase in its pressure. This increase in pressure causes the gas to spread itself out; i.e., increase its volume, or take up more space. As with a kettle, steam (i.e., water vapor = gas phase of water) experiences an increase in pressure when heated and thus escapes its confinement area (i.e., the inside of the kettle or, in your proposed case, within the butter itself) in order to accomodate its consequent volume increase. The rate at which the steam attempts to increase its volume, however, is too great to fit through the hole(s) it's alloted (this is analagous to a bunch of people trying to escape an emergency situation all through one doorway at the same time) and thus produces pressure pockets that knock up against one another and cause the audible sound waves that we recognize as the kettle whistling or the butter hissing.