When my snake prolapsed, I had let him get a little too cool (about 68F) and his feces came out incompletely digested. He also had parasites, it probably was a combination of the two.

If you can, research the net about prolapses. It is possible - if you use a damp q-tip - to gently push the prolapse back in. When I saw my vet about it, he told me if it happened again, I could do this myself. Sugar water helps shrink the prolapse and keeping your snake on damp paper towels will help protect the tissues, if you decide to wait for a vet visit.

At any rate, don't feed for at least a week afterwards to allow everything to heal, you don't want him to prolapse again the next time he defecates. You still might want to go see a vet to check for parasites.