Although the Earth-appointed Protector of the Lunar Colonies (universally called the Warden) is in charge, in practice, except for purchasing and selling commodities at fixed prices favorable to the government (the Lunar Authority), there is little intervention in Lunar society. Transportees, having served their sentences, join Lunar society. If they cannot get along in it, they are generally killed by other Loonies—there is work enough for anyone who wants it.
The narrator is Manuel Garcia O'Kelly "Mannie" Davis, a one-armed computer technician who discovers that the Lunar Authority's primary computer system has become self-aware. He names the computer Mike (after Mycroft Holmes, brother of Sherlock Holmes), the official name of the computer being HOLMES IV, where HOLMES stands for High Optional Logical Multi-Evaluating Supervisor.
Mike is given almost total control of Luna's facilities because the Lunar Authority wants to save money; it is cheaper (though not as safe) to have a single master computer and expand its capacity than to have multiple independent systems. His personality responds to this expansion by developing an infantile sense of humor. Manuel persuades Mike to help a revolution succeed.
The novel is divided into three "books" although the first is by far the largest. The action takes place in the underground warren known as Luna City, the Authority complex, and during a visit to Earth after the coup. The year is 2075, and the Lunar colonies have been established for at least 80 years. The first settlement was called Johnson City and was probably founded in the 1970s on the timeline of the novel, written in the early 1960s. The total population of all the underground warrens, consisting mostly of freed convicts and their descendants, is about 3 million, with men outnumbering women by 2 to 1, down from 10 to 1 in the early days. This has a profound effect on society and its inhabitants.
They hide in a hotel and decide it would be unsafe for Wyoh to return home or even go out undisguised. Mannie introduces Wyoh to Mike via phone, and Mike, eager to flatter a new friend, develops a female personality called Michelle for her. Mike is able to simulate either a male (Mike) or a female (Michelle) and is primarily interested in learning to understand the human sense of humor.
Using Mike's control of the phone system, they locate Mannie's former teacher, the elderly Professor Bernardo de la Paz, who was addressing the political meeting when the guards arrived. The Professor is also in hiding, moving around in disguise. He meets them in the hotel, and explains his speech of the previous night, in which he said that Luna must stop shipping hydroponically-grown wheat to Earth or face exhaustion of its resources.
Mannie introduces Prof to Mike, because Mike can tell them if Prof is correct. Prof. Paz initially objects to bringing in the Authority computer — "Why not invite the Warden himself?" he asks — but Mannie assures him that nobody in the Authority knows Mike is self-aware, and that Mike feels no loyalty to the Warden or the Luna Authority, but only toward his newfound friends. They ask Mike to calculate Luna's projected future.
Mike's news is devastating. Luna' resources will be so exhausted that the population will experience food riots in seven years, and cannibalism in nine years. Wyoh and the Professor know that this means one thing — revolution. Mannie is persuaded to join when Mike tells him the odds of success: only 1 chance in 7. A "Loonie" (Luna inhabitant, born and bred) to the core, Mannie will take any bet that offers better than a 1-in-10 chance of winning. The three of them, with Mike, declare the Revolution and form the first covert cell of an organization which will eventually grow to thousands.
There are many problems to plan for, but one looms above all. What to do when Earth tries to take its colony back? A Loonie joke about the Authority is "What can we do? Throw rocks at them?" Mike proposes to do just that. Luna sends wheat to Earth using an electromagnetic catapult. Mike realizes that loads of rock, arriving at 11 kilometers per second, will impact with the energy of a small atomic bomb. However the Authority catapult is an inviting target. They will have to build a second, secret one.
The rest of the first book deals with the myriad issues of planning a revolution. Mannie, Wyoh, and the Professor begin recruiting their own covert cells, in Mannie and Wyoh's case from within Mannie's own family. They use Mike's ubiquitous presence in Lunar society to provide communications between cells. As the movement grows, they frustrate all attempts by the Authority Security Chief Alvarez to penetrate it. All of Alvarez's spies are recruited into cells where they can inform on each other or be fed false information. New "finks" are found out almost as fast he can hire them. Mike adopts the persona of Adam Selene and deals with cell members over the phone using his ability to handle many calls at once.
A carefully executed financial swindle, covered up by Mike who does accounts for all major banks in Luna, allows them to set up "LuNoHoCo" (from LUna City, NOvy Leningrad, and HOng Kong Luna COmpany), a corporation with interests both on Earth and in Luna, dedicated to various ventures, but actually intended to buy up equipment to dig a kilometers-long tunnel for an underground catapult. A stroke of luck results in Mannie encountering a rich tourist, Stuart Rene Lajoie, who becomes their contact on Earth, helping to build a favorable climate of public opinion.
Suddenly, in May 2076, the Revolution begins without warning. Some soldiers, part of a regiment shipped up as unrest mounted, rape and kill a Loonie girl, then kill another who finds her body. Loonies riot, attacking soldiers and Authority offices. Many more Loonies die than soldiers, but the result is never in doubt. With all communications severed by Mike, the Warden and his few remaining guards and entourage are trapped in their complex and asphyxiated as Mike drastically reduces their oxygen level. The revolutionaries break in, seize the complex and its disabled residents, and end Authority rule.
Now more than ever, representatives of the new government must be sent to plead their case on Earth. Mannie and the Professor go, not in a ship, but stuffed inside a load of grain bound for India. (Wyoh has been opted into Mannie's "line" family as the newest wife prior to their departure.) The accelerations involved almost kill the Professor, but Stu LaJoie's organization is ready when they are picked up from the Indian Ocean, and he survives. Mannie recalls his previous trips for computer training. The high gravity, the crowding (Earth's population is 11 billion, North America's is 1 billion) and the rampant diseases such as colds and influenza make Earth a nightmarish place for a Loonie.
Confined to wheelchairs, with some diplomatic legerdemain from Stu, the Free Luna delegation are received by the Earth Federation. The investigating committee members turn out to be Authority stooges. The committee insists on restoring the old system, or failing that, granting limited autonomy with continued commitments to ship grain and receive convicts. The Professor states that any such commitments must be negotiated with his government, and when pressed, he and Mannie stage a scene where both collapse. This gains them some sympathetic coverage in the press.
The delegation embarks on a world tour, with Mannie touting the benefits of Luna for commerce and industry, while pushing the leaders of various countries to build a catapult that can return vital materials, water and trace elements, to Luna in exchange for grain. The result is a roller-coaster ride of hostile press conferences, secret meetings, and public speaking, culminating in Mannie being arrested in Lexington, Kentucky for polygamy.
Returned once more to Federation HQ, the delegation is presented with the Earth's final word on their request: "No". Troops will be sent, Mannie and the Professor will be interned, Luna will be converted into a tightly controlled economy, with everyone having the choice to work for the Authority at an assigned job—or return to Earth and die. In a secret meeting, Mannie is offered the job of Warden, with a strengthened military presence. The Authority hopes that a Loonie as Protector (the title officially granted to the Warden) will cause other Loonies to accept the new Regime. Mannie stalls for time. This is the event they have waited for. Mannie and Prof. Paz are smuggled out of their quarters by Stu LaJoie's organization and placed on a ship leaving for Luna. Stu goes with them, since he's deeply in debt and would be arrested for bribery and other crimes. As he says, he's saving the Authority the trouble of shipping him as a convict.
When they return to Luna, Mannie believes they have failed. On the contrary, according to Mike and the Professor, the mission was a success. Opinion on Earth is fragmented where once it was neutral or hostile, while on Luna the news of Mannie's arrest and the attempt to bribe him have unified opinion against Earth. The Authority's hard line, carefully encouraged by Prof, has ensured that Luna has no choice but to fight to be free. With the exception of the farmers themselves, Loonies are now ready to sever all ties.
While Mannie was away, an election was held with Mike running the vote count, so Mannie, Wyoh and the Professor are all elected to the new Congress, though Mannie suspects that Mike rigged the vote. Unfortunately the new body is effective where the other was not. Before they can undo all his work, the Professor addresses them. He wants no taxes, no standing armies, and a minimum of government interference in the lives of its citizens. The Congress protests, asking how they will pay for "necessary institutions". Prof responds "That's your problem." If they need government so much, perhaps they should pay for it themselves, or run lotteries.
Stu LaJoie, meanwhile, encourages the formation of a monarchy, this being the only institution that can save the people from "the worst of all tyrants, themselves." He wants Prof as the first King, with Mannie as adopted heir. Mannie buries his head in his hands and groans.
The failure of the invasion is, in hindsight, no surprise to the revolutionaries. The troops were not used to the low gravity. They were not able to run from one position to another, especially they could not descend ramps. Their weapons, firing bullets, were aimed high. Loonies, furious when roused, swarmed to attack with every available weapon in defense of their homes. Even when gas was used the invaders lost.
Mike initiates Luna's response. Cargoes of rocks are targeted to sparsely populated Earth locations, including space defense command at Cheyenne Mountain. Warnings for people to stay away from target areas are transmitted to the news media. People ignore the warnings and go to the targets to watch the show. As a result, thousands die. Public opinion on Earth is now in favor of wiping out the new nation. Even some Loonies are dismayed. The revolutionaries know it is too late to turn back, and the bombardments continue.
Mannie is sent to run the guidance computer at the new secret catapult. While there he learns that another attack has taken place, using nuclear weapons, and the original catapult has been destroyed. Cut off from the rest of Luna, he starts launching rocks even while Earth's news media broadcasts the end of the Lunar Menace. Once Earth is convinced the rocks will not stop (in actuality, Luna is quickly running out of steel for enclosing the rock), one nation after another recognizes the new nation. At last, Earth capitulates.
Mannie returns in triumph to Luna City. Professor Bernardo de la Paz, as leader of the new nation, proclaims victory to the crowds gathered in the warren's largest public space, and then collapses and dies. Mannie takes over briefly, but soon steps aside in favor of other politicians. Mannie and Wyoh eventually retire from politics. The Davis family selects Stu LaJoie as a new husband.
Mannie now realizes that the destruction of the original catapult was part of Prof's plan, kept secret even from Mannie and Wyoh. With no convenient transport to the new catapult, it will be impossible to export grain in any significant quantity until Earth has a chance to build a return catapult, assuring that Luna will not run out of food or water. But Prof saw Luna's future as a transport hub, not as a farm.
Mike is gone. In the final attacks (Mannie, with communications cut off, did not learn of them until he returned to Luna City), the Authority Complex was badly shaken, but all of Mike's central hardware remained apparently intact, buried deep in a chamber designed to withstand nuclear attack. However, Mike's personality is gone. He functions perfectly, but only as a computer. All his records and memories are now unavailable. Within the scope of the book it is implied that Mike's death is due to bombing damage, or perhaps to fear.
In the final paragraphs (set, as is the novel's first paragraph, many years after events around the revolution), Mannie complains how the Lunar government is always passing taxes and regulations, and ignoring all the Professor's ideas. There is a "Sons of the Revolution" meeting that night, and Mannie considers going but then thinks better of it. Loonies are moving out to the asteroids. Maybe he'll go with them...
"My word, I'm not even a hundred yet."
Security Chief Juan Alvarez controls the Authority police force, initially a small group of ex-convicts like Alvarez himself, then a larger contingent of troops from Earth who are angry at being shipped with no prospect of return. Alvarez's spies had thoroughly penetrated the old revolutionary organization, even recruiting members of the central committee, but his over-reaction to events in Luna City only helps fuel the Revolution. Alvarez and all the guards are killed when the attackers broke into the residence in the coup; as Mannie puts it, "would appear anoxia broke necks".
"A rational anarchist believes that concepts such as ‘state’ and ‘society’ and ‘government’ have no existence save as physically exemplified in the acts of self-responsible individuals," Prof says. In other words, all choices are made by individuals and no individual can shift or share responsibility for one's own choices.
Wyoh challenges Prof: "Professor, your words sound good but there is something slippery about them. Too much power in the hands of individuals—surely you would not want…well, H-missiles for example—to be controlled by one irresponsible person?" she says. Prof answers by saying that individuals in fact do hold the power to use nuclear weapons. "In terms of morals there is no such thing as a ‘state.’ Just men. Individuals. Each responsible for his own acts." he says.
Later in the book, Prof calls Thomas Jefferson the "first of the rational anarchists."
Lunar society is portrayed as something like a town in the Old West, with two added factors. One is the closeness of death, in the form of exposure to vacuum. According to Mannie (and by implication, the author) this means that good manners and the ability to get along with others are not just desirable, but necessary for survival. The other factor is the shortage of women, since most criminals and subversives shipped as convicts are male. Although the sex ratio in 2075 is about 2 men for each woman, as opposed to 10 to 1 or worse in earlier times (in the 20th century, as Mannie tells it) the result is a society where women have a great deal of power, and any man who offends or touches a woman uninvited is likely to be set upon by all men within earshot, and cycled through the nearest airlock.
Marriages tend to be at least polyandries, with some group marriages and radical innovations such as Mannie's own line marriage. While divorce can be as simple as walking out the door, it can take years to settle financial affairs. In discussing such an example with Stu, Mannie implies that cubic, i.e. underground, three-dimensional Lunar real estate, is customarily in the name of the woman (or women) in a marriage. In a divorce, he also implies, the separated man (or men) who contributed towards its cost would have money returned to them.
After decades during which anti-social individuals were selectively eliminated and the Authority exercised little real control in the warrens, the survivors live by the Code of the West: Pay your debts, collect what is owed to you, maintain your reputation and that of your family. As a result there is little theft, and disputes are settled privately or using informal Judges who are loonies with good reputations. Failure to pay debts results in public shaming by having the debtor's name posted in a public place. Reputation is highly important in this society—with a bad reputation, a person may find others unwilling to buy from or sell to him. However, the book makes clear that repayment of debts only goes so far on Luna- people are expected to pay back debts using all available funds, with the sole exception of their "air money", since oxygen is a public utility on Luna. As rigid as Loonie society is about individual personal responsibility, there is still a strong awareness of the implacable and inhospitable environment by which they are surrounded.
Sometimes there are set duels, but custom requires that anyone who kills another must take responsibility for the effects of the killing, paying debts and looking after the deceased's family. This is similar to the concept of blood money. Exceptions are allowed in the case of self-defense. Retaliatory killings do occur, but typically a consensus establishes which party was in the right, and there are no long-standing feuds.
With the exception of transactions that involve the Authority (wheat and water seem to be the significant ones), there is a generally-unregulated free market. The preferred currency is the dollar of the Bank of Hong Kong in Luna, one hundred of which are exchangeable for a troy ounce of gold, a supply of which was shipped up to Luna specially for that purpose. The Authority dollar (often referred to as "scrip"), circulates, but this is a soft currency, and tends to lose ground over time against the Hong Kong Luna dollar. However, transactions involving the Authority are made in that soft currency. Mannie, who contracts with Authority, is presumably paid in scrip, which, it can be assumed he then exchanges for Hong Kong Luna dollars at the going rate of three Authority dollars to one HKL dollar.
In elections held in Mannie's absence the revolutionary organization and its allies win a majority. Upon hearing this, Mannie surmises, almost certainly correctly, that the election was fixed by Mike. Democracy (the 'majority always wins' type) is very rarely viewed favorably in Heinlein's works, and in this novel, there are a number of incidents and statements which deprecate the "mob rule" of democracy.
Continuing Heinlein's speculation about unorthodox social and family structures, The Moon Is a Harsh Mistress introduces the idea of a line marriage. Mannie is part of a century-old line marriage; spouses are opted in by mutual consent at regular intervals so that the marriage never comes to an end. It is a very stable arrangement in which divorce is rare (and, in his case, he cannot recall it happening in his family), as it takes a unanimous decision of all the wives to divorce a husband. Such a marriage gets stronger as it continues, as the senior wives teach the junior wives how to run the family; it also gives financial security and ensures that the children will never be orphaned. Children marry outside of the line marriage.
The social structure of the lunar society features complete racial integration, which becomes a vehicle for social commentary when Mannie, visiting the Southern US, is arrested for polygamy after he innocently shows a picture of his multiracial family to reporters. He later learns that the "...range of color in Davis family was what got judge angry enough..." to have him arrested. He also learns that this arrest was anticipated and provoked by his fellow conspirators to get an emotional supportive reaction from Loonies when the arrest is announced.
The novel is notable stylistically for its use of an invented Lunar dialect consisting predominantly of English words but strongly influenced by Russian grammar, especially omission of "the" which does not exist in Slavic languagues (cf. Nadsat slang from A Clockwork Orange by Anthony Burgess). This influence came from a large number of Russian deportees.
However, there was a good deal of political consolidation, e.g. unification of the entire North American continent under a successor government to the United States, and political unification of South America, Europe, and Africa into fellow mega-states. The Soviet Union seems to have lost the land east of the Urals to China, and China has conquered all of East Asia, Southeast Asia, eastern Australia and New Zealand (deporting lots of unwanted people to Luna in the process). This Chinese aggrandizement is similar to that described in Tunnel in the Sky and, to a lesser extent, Sixth Column. The militarily dominant nations seem to be North America and China. India is overcrowded but seems to have enough clout to get the lion's share of wheat shipments from Luna.
It is suggested that the Western nations, including North America, have become corrupt and authoritarian, while holding on to the vestiges of the pre-war democratic idealism in propaganda and popular culture. China, on the other hand, is portrayed as plainly and unabashedly despotic, but probably no less technically advanced than the West. The Soviet Union, or "Sovunion" seems to have relatively little influence. The Lunar Authority itself is portrayed as corrupt and despotic while covering up for that with glib propaganda.
When planning the revolution, Mike is described by Mannie as "our Scarlet Pimpernel, our John Galt, our Swamp Fox, our man of mystery", referring to the works of the Baroness Orczy and Ayn Rand as well as to the history of the American Revolution. There are intentional parallels to the American Revolution; Luna's Declaration of Independence is issued on July 4, 2076, and one event is referred to as paralleling the Boston Tea Party.
When discussing the resource loss on Luna and likelihood of ensuing food riots, Professor de la Paz suggests that Mannie read the work of Thomas Malthus.
Late in the novel, a reference is made to the possibility of humans flying on the moon, to which Mannie comments that he thought the speaker had "tripped his safeties". This is a reference to Heinlein's short story, "The Menace From Earth", involving flying on the moon with artificial wings, which include "safeties".
Colorado Springs itself is mentioned as being nearby the military target Cheyenne Mountain which took a direct hit during "Wet Firecracker War". There was surface damage, but neither the military complex nor the city was greatly damaged. The mountain is hit many times by rock missiles from Luna, both for symbolic effect and in the hope of disrupting space defense command.
The Headquarters of the Lunar Authority on Earth are in the city of Agra, India site of the Taj Mahal. The bombardment from Luna omits the city of Agra from its target list out of respect, and also because Prof. Paz loves the mausoleum for its beauty. The revolutionaries keep threatening to hit it, but never do. Mannie, a New York Yankees fan, visits what is presumed to be Yankee Stadium, now expanded to hold at least 200,000 people. He also visits Salem, Massachusetts and Concord, Massachusetts.
Lasers are used primarily as mining and cutting tools (Mannie, the narrator, having lost his arm to an ice mining accident with a laser), but are adapted as both hand and ground-to-orbit weapons by the Loonies.
Luna's industries use both solar power and hydrogen fusion. Heinlein correctly quotes the maximum yield of solar cells at about 1 kilowatt per square meter, but is over-optimistic with regard to fusion, describing it as taking place in small magnetic pinch bottles.
Mannie refers to a comrade, Foo Moses Morris, who following the revolution, co-signs much paper to keep the new government going. He winds up broke and starts over with a tailor shop in Hong Kong Luna. This parallels Robert Morris, who helped finance the American revolutionary government and also suffered financial reverses.
While on Earth, Professor Bernardo de la Paz purchases a small brass cannon, originally a "signal gun" of the kind used in yacht racing. When Mannie asks him why he bought it when every kilogram of mass going back to Luna is so expensive, the Professor relates the following parable:
The Professor means that self-government is an illusion caused by failure to understand reality. He asks Mannie to make sure that Luna adopts a flag consisting of a brass cannon over a red bar on a black background with stars, "a symbol for all fools who are so impractical as to think they can fight City Hall." Before leaving politics, Mannie and Wyoh carry out his wish.
Heinlein owned a small brass cannon, which he acquired prior to the 1960s. For nearly 30 years, the firing of the brass cannon, or "signal gun", was a 4th of July tradition at the Heinlein residence. It is believed that this cannon was the inspiration for Heinlein's original title for the work which eventually became "The Moon Is a Harsh Mistress". Virginia Heinlein retained the cannon after her husband's death in 1988. The cannon was eventually bequeathed to friend and science fiction writer Brad Linaweaver, after Virginia Heinlein died in 2003. Linaweaver restored the cannon to working order and subsequently posted a 2007 video of it being fired several times (with very small charges) on YouTube.
Some of the lunar colonists who decide to break free of their earthly rulers would often scrawl anti-authoritarian graffiti on walls, signing it "Simon Jester". Claire Wolfe and others have suggested that those who find the American government oppressive do the same, perhaps even using the same moniker.
Examinations of Rational anarchism