Somewhat counter intuitively, and to great frustration of the person behind. The safe thing to do when someone is tailgating is to give more space in front of you so that you can brake more softly giving them more time to react.
Or pull over and let them pass, as people often use tailgating to attempt to indicate the car in front is too slow.
Edit: (tailgating = follow too closely)