How does a small gang of lightly armed Somali pirates hijack a modern cargo ship?

Speed and weaponry, mainly. Modern pirates, whether off the coast of Somalia or in the crowded shipping lanes of southeast Asia, typically use fast speedboats to zoom up to the sterns of slow-moving cargo ships. They then toss grappling hooks up to the rails and climb up ropes to clamber on deck.

Pirates are generally armed with assault rifles and, increasingly, rocket-propelled grenade launchers. Modern ships' crews are usually unarmed for a number of reasons, among them laws that prevent armed vessels from docking in the ports of many countries.

"The maritime unions, shipping companies and the International Maritime Organization all agree that ship's crews should not be armed," says Capt. George Quick, vice president of the International Organization of Masters, Mates and Pilots, based in Linthicum, Md. "It would only escalate the situation The [Somali] pirates are pretty well funded, and they'd just get bigger weapons."

• Click here for more photos.

• Click here for FOXNews.com's Patents and Innovation Center.

Modern ships also don't need many people to sail them — the 500-foot, 17,000-ton Maersk Alabama has a total of 20 crewmembers, including the captain. Hence it's pretty easy for pirates with AK-47s to boss them around, provided they can find all the crewmembers.

So if the cargo ships can't fire back, how can they defend themselves against pirates? A number of non-lethal solutions have been suggested and tried, some low-tech, some practically science fiction.

Fire hoses. The simplest way to repel boarders is to train high-pressure hoses on them. Spraying them straight down the sides of the ship at bad guys trying to climb aboard usually works. But there's a catch — if there's more baddies standing in the speedboats aiming guns at the crew, then you have to give up.

"Some companies encourage the use of fire hoses, but even that's controversial," says Quick. "When you've got a boatload of guys with AK-47s pointed at your crew, it's not really a fair fight."

Remote-controlled fire hoses. To get around that logistical problem, several companies market high-pressure water cannons that can wash pirates overboard without exposing anyone to enemy fire.

Molotov cocktails. If ships' crews aren't given weapons, they can always make their own. In December, Somali pirates shadowed the Zhenhua 4, a Chinese cargo ship, for days, giving its crew ample time to prepare a stockpile of Molotov cocktails using empty beer bottles.

The baddies got on board, but the crew used the homemade bombs and fire hoses to fend them off for six hours, enough time for Malaysian Navy helicopters to show up and scare the pirates away.

Quick advises against such heroics, however.

"Standard maritime doctrine is that crews should not resist once boarders are on deck," he says. "The [Somali] pirates are really just after the ransom money, so it's best to keep things as calm as possible."

Sonic weapons. In November 2005, the cruise ship Seabourn Spirit in the western Indian Ocean fended off pirate speedboats, partly by blasting them with an long range acoustic device (LRAD), which is designed to cause painful level of sound up to 300 meters away. (The Seabourn Spirit also ran over one of the speedboats.)

That, ahem, sounded great at the time, but a similar use of an LRAD three years later didn't stop a chemical tanker from being seized by more Somali pirates. The bad guys may have figured out that earplugs or blast muffs greatly reduce the LRAD's effectiveness as a weapon.

Slippery foam. Boat decks are wet places. Somali pirates are often barefoot. Hence the need for what the acronym-happy Marine Corps calls its Mobility Denial System (MDS), also known as Non-Lethal Slippery Foam (NLSF) or Anti-Traction Material (ATM).

Basically, it's water, drilling-mud additive (used for boreholes) and a flocculent, an electrically charged suspension of solids that makes liquids even more slippery. No one's actually deployed this stuff yet, but a few serious squirts would send pirates sliding around helplessly like happy penguins on an ice floe.

Rubber bullets. Riot police typically fire non-lethal projectiles from real guns, which wouldn't be allowed on many ships. But high-powered air guns could fire plastic or rubber bullets almost as easily, causing pain if not serious injury to boarders hit in the torso or limbs. Head shots could cause injury or even death, however, and there's always the chance they could be used in a mutiny.

Electric fencing. At least one company sells a high-voltage fence that sticks horizontally outward from a ship's sides, zapping any would-be boarders like so many wayward cattle.

"Only a few [ships have that] so far," says Quick. "I don't know if it's worked or not. In the long run, nothing will against a persistent group of pirates."

Nets. In the same way that police lay out nail strips to stop speeding cars, ships could launch small nets into the water to entangle the propellers of the pirate speedboats. The Coast Guard and the Dept. of Defense are testing these by dropping these from helicopters, but it's possible smaller versions could be launched from the stern of a cargo ship using the sort of catapults that launch clay pigeons in skeet shooting.

Blinding weapons. Airline pilots already deal with jokers who shine laser pointers into the cockpits of landing planes. Pirates might have to face the Dazzle Gun, a futuristic-looking laser rifle designed by the Air Force that temporarily blinds adversaries who get too close to bases and personnel.

The pain ray. The Air Force had fun a couple of year ago bringing reporters to a test facility at Moody Air Force base in Georgia and zapping them with the Active Denial System, a truck-mounted weapon that focuses a tight beam of electromagnetic waves on your skin.

Basically, it's like sticking your hand in a microwave oven. It's nonlethal and very painful. There's a smaller version as well that's effective up to 500 yards, which might work against pirates coming up to a ship.

Quick, however, feels that nothing can really stop the pirates short of a naval engagement.

"It's not really up to the ship owners or crews to solve the pirate problem," he says. "It's a governmental issue. It's why navies were formed in the first place."