This is a common feedlot problem. Sometimes they do it if they are riding other animals. Sometimes if they are a little constipated, or sometimes if they are the opposite, and straining from scouring. Whatever the cause, early treatment is the important thing to remember. If you can get it back in before it is too irritated, sometimes it will stay in by itself. If it gets really swollen and irritated, that alone can make them strain even more.
When we have this happen, we'll get the calf into the chute really quick, soap it up, put it back, and give them a shot of antibiotics and some Predef to help take down the swelling. Then we keep them alone somewhere for a couple of days and see if it all stays where it belongs.
If not, then the vet gets involved. Then it usually involves stitches to keep it in, and that works really well. You do have to figure out what caused it in the first place though, so it won't happen again.
Let us know how it turns out.