I used to understand fasting as a way to discipline my "body", much in the way that one would exercise muscles to strengthen them. That is, fasting would help me grow stronger spiritually. I now think of fasting as a way of metanoia. Fasting is a way that I help my body to let go of the habits of my sin, both inquity and daily transgression.
As I fast I become more aware of my continual suffering, which motivates me to call to God for help: O God come to my assistance! So, prayer is a natural consequence of fasting. So are my myriad attempts to avoid this suffering. And I'm so accomplished at avoiding suffering that I don't realize how automatic are my responses until I purposefully stop them. Thus, fasting is painful not because I'm deprived of nutrition but because I'm less able to distract myself with food.
The practice of charity is how I change in the midst of it all. This is the hardest part of fasting because I'm not only cranky, I'm self-righteously so. I deserve my goodies and others should be nice to me because I'm suffering. I don't want to receive the mercy for which I repeatedly ask ("Kyrios eleison"). I desperately want the familiar soothing of food because the mercy of God does not "feel" good the way eating does. I want consolations, not the desolations of letting go of my familiar and cozy pain, which leaves me less full. Of course, when I'm less full, I have more room for the Holy Spirit to work through me. It is in kenosis, this emptying of false consolations, that God works through me. In the end, it is not my charity that changes me, it is the Spirit working in the midst of my desolation. When I fast successfuly I am more at peace and in joy, the fruits of the Spirit working through me.