Surgery vs. padding.
If you catch hammertoes in the early stages, a small, in-office procedure to release one of the tendons will often allow the toe to lie straight again.
If the toe deformity has become rigid, the surgery is more involved. It's an outpatient procedure in an operating room, and can involve bone cuts, pins, screws, or other implants. Without surgery, your best bet is padding to reduce your discomfort.