How do I connect a dryer with a four prong plug to a three prong socket?
You could replace the cord on the dryer, but you'd have to bond the chassis of the dryer to make that acceptable to current NEC codes (Article 250.140). This can be a safety hazard if done incorrectly, and it may or may not void the warranty on the dryer.
Since your dryer is set up to use a 4 prong receptacle, the optimal solution would be to update the receptacle to a 4 prong (NEMA 14-30R if I remember correctly).  However, this will require you to run new cable to the receptacle, since you'll need a cable with a ground. Depending on the draw of the dryer and the length of the run, you'll either have to pull new 10-3 /w ground or 8-3 /w ground cable.
EDIT:
As @TheEvilGreebo pointed out, you may be able to simply swap out the cord on the dryer for a 3 prong version. Check the manufacturers documentation to verify the procedure, and to make sure your model supports this.
EDIT:
This schematic for an electric dryer might help you understand how the dryer could be wired (depending on make/model/manufacture date).