Isn't the traditional response to post a few blokes with guns, big guns, and attempt to blow any pirates out of the water? Aren't ship's crew using guns for protection?
You'd think so. There must be legal issues with this approach, since you'd have to have deck-mounted machine guns to have much chance. Or maybe, as with everything else described in this article, deck-mounted machine guns wouldn't have enough cost-benefit.
Also, weapons on merchant ships can be taken by the pirates and used in future attacks. So unless the weapons allow the crew to consistently prevent hijackings, they're just increasing the pirates' revenue.
A substantial part of why foreign flagged merchant vessels get easy access to ports is that they are "known" to not be armed.
We wouldn't let a <pick a foreign country not too friendly with us> warship steam into Boston Harbor. Same country's oil tanker or cargo ship? Come on in.