I've seen this handled a number of ways, everything from the characters being handed off to other players as cohorts for the night to a Big Blue Hand reaching down from the sky and carrying them off to a safe haven. In my current group, everyone is asked what they want to be done with their characters before a new campaign begins. The options are Full Participation for full XP or Script Immunity for 1/2. Full participation means the characters fight, disarm traps, and generally do everything they would normally do if the player was there, usually under the control of another player. This also means that there is a possibility of injury and/or death. Script Immunity means that the character is assumed to be there, but is simply left out of dangerous situations. It works out fairly well.
Unfortunately, in games which involve any real amount of roleplaying interaction, this can be difficult to pull off. Done sparingly, it can work; everyone involved knows that Player X is not there to roleplay his character, so interaction with him is kept at a minimum, if at all. Done on a regular basis, it can degrade the level of roleplaying.