The various nations should equip "Merchant Raiders" to deal with the problem. Such ships were used successfully in WWI. "Q-ships" were used successfully in WWII against German U-Boats. The Q-Ship was an armed war ship disguised as a merchant. The Merchant Raiders were merchant ships that had been heavily armed with 6 inch guns. As they approached the victim the side would drop and the gun was revealed.
Imagine the final look and last words of a Somali pirate as the side dropped and the concealed gun fired!