The players on rehab will usually come to the field earlier and go to the training room to get treatment, and if needed they will go to the gym to work out. All their workouts are tightly monitored by a trainer. Each rehab player will have a timeline set for their return to games. Of course that timeline can be met only if they put in the work to get them self fit. Once they can see that the player is ready, he will be put in games.
When a pitcher comes off the disabled list, he will start the game and throw an inning, then the regular starter will throw after him. This has happened to me on 3 occasions in Extended Spring, having to pitch in relief of rehab pitchers when I was expected to start the game. If it's a position player coming off the disabled list, he may hit once every 2nd inning so they can get plenty of at bats, of course they can only do this in an Extended Spring game since they are not official games.
Often we will get a Major Leaguer down here to rehab, just recently we had Kevin Slowey here in Extended Spring Training, who has been part of the Minnesota Twins starting rotation the last 3 years. One day I was scheduled to start, but had to throw in relief as Slowey started that game.
It takes a lot of motivation to get out bed everyday when you're on the disabled list, and that's why I have a lot of respect for all the guys who are on rehab and come to the field everyday, knowing they can't play, throw, hit or run, they do everything they can to get back on the field as quick as they can.