I'm curious how crime and discipline were handled aboard ships (All different answers, I expect) during the age of sail. I believe military officers were empowered to summarily execute members of the crew in extreme situations/offenses, but what about merchant or pirate vessels? Did it vary vastly from ship to ship (I expect this is the answer for pirates) or was the an agreed upon charter/law for Captains to follow?
In the British navy, at least, there was absolutely not anything like summary execution for ill-behaving sailors. Any capital punishment would have to be carried out only after the findings of a court-martial, presided over by a senior captain or admiral with captains and/or flag officers sitting in judgment. The accused was able to speak in his own defense, call witnesses, etc.
The rules of the judiciary, and other punishments, were codified in the British navy as the Articles of War. You can read them here:
http://www.hmsrichmond.org/rnarticles.htm
They were read out to the crew on a ship's commissioning and at least once a month during Sunday services.
Now, as to traditional punishments, captains had wide latitude to order sailors to be arrested and to punish them in a variety of ways. Flogging was very common, though contrary to popular myth, captains were limited by tradition and the Articles of War to give sailors only a certain number of lashes. (Some captains flouted this rule, often disastrously; cf William Bligh or the Hermione mutiny, etc.). Other punishments might be time in the brig, extra duty (pumping ship, greasing masts), or stopping perquisites (beer/wine/spirits, tobacco, etc.). But no, they certainly could not arbitrarily execute a sailor without facing judicial judgment at some point.