In June, the U.S. House of Representatives passed an amendment that would require the Department of Defense to put armed teams on U.S.-flagged ships passing through high-risk waters, specifically around the Horn of Africa. The amendment now goes to the Senate.
This is a revival of the 'Q' ship idea. Actually, armed merchantmen have been with us since prior to the Romans. 'Q' ships were armed with guns that they could use to defend themselves against subs when they approached on the surface. This worked well in World War I when international law required merchant ships to be searched prior to being sunk. (The law was ignored in World War II, by all sides)
In the case of Somali, very little in the way of defense will be necessary. If the pirates upgrade their weapondry, a few well trained and well placed riflemen may not be enough, but today this would probably be plenty.