Can be caused by many things.
I am am assuming that there isn't a structural problem with the foot (ie: broken bones that have healed incorrectly, bone spurs, etc) which should be best addressed with a doctor.
The most likely thing is the kind of shoe that you are climbing in and the fit. A shoe with a down turned toe, especially if its fitted tightly will certainly cause the pain when crack climbing. Its best to find a shoe that has a flat toe that is snug but not tight. The toes should not be curled. A standby for desert cracks (such as Indian Creek) is the 5.10 Mocasyms. They are great for thin hands (ie: ringlocks) on up, but if you need to edge on stuff when the crack is even thinner, they are out of their realm. My personal favorite for all cracks regardless how difficult they were, is the discontinued LaSportiva Barracuda's. In the LaSportiva lineup, the Muira's (both womens and mens), the Katana Lace-ups, the TC Pro's and the Mytho's all fall into this catagory. In the 5.10 lineup, the Mocasyms, Copperheads, and they have a high top out. I know Mad Rock has a velco shoe that fits into this catagory also.
In some cracks, there will be pain, such as tight hands. It becomes how much do you really want it. The pain will also get better as you get used to it, so in the painful size start out in large doses (sorrry, I mean small doses) and slowly get used to it. As your technique gets better, the pain will also get less
Perservere, it gets better