Not really a lot of options. Depending upon the speed, distance, time involved you can either try to run the ship aground so that it beaches itself without hitting a structure, or perhaps drop the anchors and hope that they can dig in and get it stopped in time.
Some places will require a ship that's in very tight Waters to have people stationed right on the anchor switches so they can drop them in an instant if a problem happens. Other places will have ships already tied up to tugboats before they get to a narrow area and they can hopefully get it under control before it runs into something.