'I would consult a doctor first, and he/she can tell you how to do it safely. Beyond that, there is no special prayer or proper way to end it (though I suspect an eating binge would not be a smart idea).'
Peripatetic, do not be decieved. We do not need to see a doctor to fast, God is our healer. The flesh counts for nothing, the Spirit is everything.
Jesus said
"When you fast, do not look somber as the hypocrites do, for they disfigure their faces to show men they are fasting. I tell you the truth, they have recieved their reward in full. But when you fast, put oil on you hear and wash your face, so that it will not be obvious to men that you are fasting, but only to your Father, who is unseen; and your Father, who sees what is done in secret, will reward you."
Fast to show God you rely on him completely. Only recently the Spirit revealed to me I should fast. When I have, I see the manifestation of God's love as he completely carries me through my work and worries when I have not eaten and my flesh is telling me I need food. God has never had me fast for longer 12 hours after rising, others may fast for days. Fasting is unique to all; God's relationship with every man on Earth is completely unique. The flesh counts for nothing, the Spirit is everything.
When you fast, rely on God to carry you. He wants you to rely on him in all things like a little child.
Jesus said "I tell you the truth, unless you change and become like little children, you will never enter the kingdom of heaven."