For two years now, the Yemen Coast Guard has worked with private security companies, to provide paid ( $25,000-74,000) escorts for ships traversing the pirate infested Gulf of Aden. The Yemeni Coast Guard will provide one of its own patrol boats for the high end escort service, and will put a few of its personnel on the protected ship, along with a larger number from the private security company. All the security personnel are armed and trained to detect and deal with pirates. The presence of the Yemeni Coast Guard sailors makes it all legal because, according to current laws, armed pirates killed by security guards is technically murder, and could result in lawsuits against the ship owner. But with Yemeni Coast Guard personnel on hand, it becomes a police matter, and the armed pirates are, well, armed pirates.
Currently, ships moving through the Gulf of Aden (to and from the Red Sea and Suez Canal), or anywhere near the Somali coast, have several options when it comes to dealing with the pirates. The cheapest, and most dangerous, approach is to do nothing, and take your chances. Only about one in 500 ships is taken, although the pirates look for the unprepared. So doing nothing increases your risk to about one in 200. For about a quarter of the captains, those are reasonable odds. More prudent captains can post more lookouts, increase speed and zig-zag for a few days, until clear of pirate infested waters. That can cost the ship owner $50,000 or more (for fuel, mainly, and extra pay for the crew). Next up comes working closely with the warships patrolling the area. This informal fleet runs escorted convoys through the Gulf of Aden, and less formal arrangements off the east coast. This costs ships time (which is expensive), and requires following orders. But it means that, even if the pirates come after you, or even get aboard, help is nearby. The most secure approach is to hire the security firms. That can cost more than $100,000 (fees and extra fuel), but it just about guarantees that your ship will be safe from attack. For ships carrying very valuable, or vulnerable (chemicals, weapons, whatever) cargoes, this is the best way to go.
The Gulf of Aden is one the busiest shipping lanes in the world (with nearly ten percent of all traffic). Each month, 1500-1600 ships pass the northern coast of Somalia. For the last two years, 3-4 of those ships have been seized (and up to ten, or more, attacked) by pirates each month. That's one ship out of every 400-500. But with the pirates getting more and more ransom money for each ship, the number of pirate groups operating in the Gulf of Aden is increasing.