That is one of the many reasons the technology exists. Use another office, conference room, library or somewhere other than your office to work uninterrupted. Write yourself a note about where you left off for easier re-entry when you come back to something. The time you take writing the note will often be less than reading back into where you left off. You will be both gracious and in control of your time in this way.
People are less likely to hang around if they are standing.
Work earlier or later than others in your business to minimize interruption. The adjustment ill be minor inconvenience.