A big oil producer unable to pay its bills during a protracted oil-price boom is a rare beast. Thanks to colossal economic mismanagement, that is exactly what Venezuela, the world's tenth-largest oil exporter, has become.

At the end of the second quarter Venezuela's trade-related bills exceeded the $21 billion it currently holds in foreign assets, almost all of which is in gold or is hard to turn into cash.

Over $7 billion in repayments on its financial debt come due in October. The government insists it has the means and the will to pay foreign bondholders. Few observers expect it to miss the deadline. Even so, the dreaded word "default" is being bandied about.

On Sept. 16, Standard & Poor's, a ratings agency, downgraded Venezuelan debt, assessing the country as "vulnerable and dependent on favorable business, financial and economic conditions to meet financial commitments." Reports that the government is seeking to sell Citgo, a U.S. refining subsidiary of Petróleos de Venezuela (PDVSA), the state oil firm, have fueled talk of cash-flow problems.

Even if it stays current on its financial dues, Venezuela is behind on other bills. Earlier in September, two Harvard-based Venezuelan economists, Ricardo Hausmann and Miguel Angel Santos, caused a stir by criticizing the government's decision to keep paying bondholders religiously while running up billions in arrears to suppliers of food, medicine and other vital supplies. "To default on 30 million Venezuelans rather than on Wall Street," they wrote for Project Syndicate, a website, "is a signal of [the government's] moral bankruptcy." President Nicolás Maduro branded Mr. Hausmann a "financial hit man" and threatened him with prosecution.

Another Venezuelan economist, Francisco Rodríguez of Bank of America Merrill Lynch, thinks that scarcities of basic goods stem from the government's refusal to adopt sensible exchange-rate policies. On the black market a dollar trades for over 90 bolívares; "official" dollars are worth between 6.3 and 50 bolívares, depending on which of the country's multiple exchange rates you use. Exports of oil and its derivatives, which are dollar-denominated, account for 97% of Venezuela's foreign earnings. Using an overvalued official rate means that the country is not making as much money as it could: The fiscal deficit reached 17.2% of GDP last year.

The government has been bridging that gap in part by printing bolívares. That has caused the money supply to almost quadruple in two years and led to the world's highest inflation rate, of over 60% a year. Food prices, by the government's reckoning, have nearly doubled in the past year, hitting the poor, its main constituency, hardest of all.

Even worse than inflation is scarcity. The central bank stopped publishing monthly scarcity figures earlier this year, but independent estimates suggest that more than a third of basic goods are missing from the shelves. According to Freddy Ceballos, president of the federation of pharmacies (Fefarven), six out of every 10 medicines are unavailable. The list runs from basic painkillers, such as paracetamol, to treatments for cancer and HIV. One unexpected side effect has been a sharp increase in demand for coconut water, which Venezuelans normally buy to mix with whiskey. Nowadays it is sought out more for its supposed anti-viral and anti-bacterial properties.

Unable to obtain what they need through normal channels, people are having to improvise. Social media are packed with requests for urgently required medicines, while some highly sought-after goods — babies' diapers, say — are offered in exchange for others, like spare parts for cars. Those lucky enough to have friends or relatives abroad arrange for emergency relief. "My cousin in Panama sends my mother's Parkinson's treatment," said one Caracas resident. "It costs $30 a time there, compared with a few bolívares here, but here you can't get it." An opposition political party has even asked the Red Cross to help relieve the scarcity.

The mess is a reflection not just of import-dependence and a shortage of dollars, but also the mismanagement of domestic industry. Some food producers have been nationalized; price controls often leave manufacturers operating at a loss. Some price rises have recently been authorized, but manufacturers say it is impossible to maintain normal output with such policies. For its part, the government blames what it calls an "economic war" and the contraband trade.

The prospects for a change of course are gloomy. On Sept. 2, Mr. Maduro replaced the vice president for economic affairs, Rafael Ramírez, with an army general; Mr. Ramírez also lost his job as chairman of PDVSA in the reshuffle, which saw him moved to the foreign ministry. Under Mr. Ramírez, PDVSA has not thrived. Oil exports have fallen by over 40% since 1997 because of lack of investment, offsetting the benefit from price gains.

Venezuela's streets are calmer now than earlier this year, when clashes between opposition protesters and government forces left more than 40 people dead. The reshuffle appears to have strengthened Mr. Maduro's position. Bondholders may well keep getting paid. But the price of the revolution's survival seems to be the slow death of Venezuela.

Copyright 2013 The Economist Newspaper Limited, London. All Rights Reserved. Reprinted with permission.