Nail pain may develop due to a nail infection, ingrown nails, or injury to the nail. Nail biting and hangnails can also cause sore fingernails or toenails. Treatment can depend on the underlying ...