According to The New York Times, “companies that are struggling to pay creditors and suppliers are managing to find millions of dollars to pay bonuses to their bosses. The payments, which are made just before a bankruptcy filing, appear to be legal and have been made by several companies.”

J.C. Penney, which will close 154 stores, paid its chief executive, Jill Soltau, $4.5 million. “The chief executive of Whiting Petroleum, which sought bankruptcy protection in April, received $6.4 million, and Chesapeake Energy is paying bonuses ahead of an expected bankruptcy filing. Executives at Hertz also got payments before the rental-car giant sought bankruptcy protection,” The Times reported.

Companies have said that the payments “are meant to help them retain qualified executives through the recession and bankruptcy,” wrote The Times. “But critics counter that the money would be better spent on rank-and-file employees.”

“It makes me angry because they are not taking care of the people who are actually making the money,” said Liz Marin, who worked at Toys “R” Us when it filed for bankruptcy and is now an organizer in training at United for Respect, a nonprofit organization that seeks to help retail workers. Toys “R” Us was also one of the companies that paid bonuses to executives before its bankruptcy.

Chief executives who lead companies into bankruptcy are usually at risk of losing their jobs, but “other corporate boards, which hire the chief executive and set compensation for senior officers, seem to be showing grace toward the boss,” The Times wrote. “Certain outlays that a company makes just before bankruptcy — for instance, payments to suppliers — are at risk of being clawed back. But the bonus payments typically don’t fall into that category, legal scholars say.”

The Times explained that the “stock of a bankrupt company is most likely going to be wiped out or be worth little once a company resolves its bankruptcy or, in extreme cases, sells off its assets and goes out of business. As a result, boards have quickly changed how top officers are paid, giving them cash bonuses instead of stock-based awards.”

“The companies are creating certainty for their C.E.O.s at a time of the greatest uncertainty for the employee base and the company in general,” said Brett Miller, head of data solutions for the responsible-investment arm of Institutional Shareholder Services, which advises investors on corporate governance issues.

“This is not the first time that executive pay at troubled companies has prompted an outcry. Congress passed a law in 2005 aimed at curbing retention bonuses paid during bankruptcy. Under the law, companies are allowed to pay incentive-based bonuses, but the legal cost of constructing such payments and getting them approved in bankruptcy court soared after 2005, according to research by Jared Ellias, a professor at the University of California’s Hastings College of the Law.

Congress could change bankruptcy law so that compensation payments made before the filing could be clawed back, Ellias said. “In addition, lawmakers could make it easier for creditors to pursue claims against executives after the bankruptcy,” The Times added.

“This doesn’t feel right,” Ellias said of the recent large bonuses, “and it doesn’t instill public confidence in the bankruptcy system.”

Read the full report here.