The invention relates to pyridone amide compounds of formula I and I'or pharmaceutically acceptable salts thereof, useful as inhibitors of sodium channels: The invention also provides pharmaceutically acceptable compositions comprising the compounds of the invention and methods of using the compositions in the treatment of various disorders, including pain.