Password storage as the cornerstone of security

How online services should store user passwords, and how to minimize the damage in the event of a leak or hack.