I had a baby ball python about fifteen years ago that did that. I contacted my dads friend who is a herpetologist and he told me that it is a fairly common condition he called "flashing" or a prolapse. The cure he prescribed to me was clean the area well with vasoline and simply shove it back in. And that's exactly what I did, I shoved it back in towards the head with my pinky finger. It worked just as he said it would. If I were you I would take any substrate out and lay moist paper towels on the cage floor and maintain a high level of cleanliness to avoid any funk from touching the prolapse. And I would'nt feed untill the problem is gone and then I would wait at least two weeks after to make sure that it won't happen again. I'm by no means a expert but if I were in your position this is exactly what i'd do I hope this info helps, keep us updated and good luck.
Wayne Sanders