These days, the gangs rely on short-range speed boats and attack in places like the Straits of Malacca of off the coast of Somalia. These pirates are usually equipped with guns (including assault rifles like the AK-47) or knives. Piracy has also occurred off Bangladesh, Nigeria, Iraq (six attacks since April despite coalition naval units in the area), and the South China Sea.I assume that there is a typo in the piece and that the author meant to write "Straits of Malacca or (not "of") off the coast of Somalia."
Again, it is necessary to take a close look at reported piracy activity. Much of what gets reported is actually common theft and/or armed robbery, as when a robber or group thereof manages to climb aboard a ship at anchor and steal material or hold up the crew and take money and personal valuables. Since generally this takes place in harbors and ports, it is similar to thieves breaking into a warehouse ashore and stealing things.
Prevention of such crimes is (or should be) a local police responsibility.
One the other hand, there are attacks on ships underway which result in either, again, simple robberies of the crew or the more serious capture of the ship. When a ship is captured at sea, the pirates may dispose of the crew and sell the ship and its contents or divert the ship to a pirate safe haven and seek ransom for the release of the crew and the ship. See here and here for examples of ship seizures.
Technically, if the ship seizure occurs in the territorial waters of a country, it is still called "sea robbery" (see here for an explanation) and the local government is suposed to take action. If the seizure occurs on the high seas (not in the territorial waters of any nation) only then is it really piracy.
Part of the current situation off of Somalia involves "real" piracy - attacks on ships transiting in international waters. Part involves attacks in Somali waters. With no government to take action against them, the Somali pirates have had more or less free rein.
The author of the Strategy Page piece also suggests that merchant ships might be armed for transits in dangerous waters.
Many others have suggested a "Q-ship" approach. See here for information on Embarked Security Teams, Q-ships and Naval Armed Guards. And, finally, some info on modern ship protection systems is contained in this post.