Hammertoes and Clawtoes
A hammertoe is a deformity of one or more of the lesser toes. The hammered toe will stick upward at the base of the toe, then bend downward.

The tip of the hammered toe may strike the ground or insole of the shoe, and a painful corn or callous may develop there. Some hammertoes have a callous form over the bump on top of the toe.

Hammertoes may form together with other forefoot problems such as bunions, bunionettes, or Morton’s Neuroma. Some hammertoes can occur with a dislocation in the joint at the base of the toe. There may be a callous under the base of the toe that is tender.
How Hammertoes Develop
The normal alignment of each toe is due to a balance between muscles in your leg and in your foot that flex and extend the toes. Hammertoes will occur when the balance between these different muscles is distorted. Hammertoes are usually caused by shoes that are “too tight”. If your shoe is too narrow or small the toes will get squished, and will take on the appearance of a hammertoe.
When hammertoes begin to form they are usually flexible. That is, the toe may be straightened when it is manipulated manually. As the hammertoe deformity ages it can become fixed. It is then not possible to straighten the toe out.
Treatment
Flexible hammertoes usually require no specific treatment, just wearing shoes with an adequate toebox. Exercises to strengthen the “intrinsic” muscles may be helpful. With these exercises you use your toes to grip the insole of your shoe over and over, like a cat grasping with its claws.

There are some devices that can be put over a single flexible hammertoe to hold it straightened.

Fixed hammertoes are treated by wearing shoes with a large toe box that will accommodate the deformity and not rub against the toe. If this is not satisfactory, then surgical treatment can be performed. There are several different operations that are used, and the decision on which is best.
When all of the toes have a hammered appearance this is often called “clawtoes”.

Clawtoes are usually caused by some problem extrinsic to the foot. Examples include diabetes mellitus, prior trauma to the leg or foot, having worn a cast on the leg for an extended time, alcoholism, peripheral neuropathy, and some hereditary neuromuscular disorders.
Go here for a discussion of Hammertoe Surgery.