When a company declares bankruptcy, its stock still trades, though its ticker symbol changes. That's what's currently happening with J.C. Penney (OTC:JCPN.Q), the struggling department store chain that has filed for Chapter 11 bankruptcy protection.

The retailer hopes to emerge from bankruptcy with a smaller profile and has begun closing nearly 250 stores. It also has deals in place for the funding it needs to operate in the short term. In the longer-term, there are published reports indicating that its landlords Simon Property Group (NYSE:SPG) and Brookfield Property Partners (NASDAQ:BPY) are rumored to be interested in buying the company.

That's good news for J.C. Penney management and some employees who may keep their jobs. It's also good news for shoppers loyal to the brand who don't want to see it go away.

The news, however, is not good for investors who own shares of the company's stock. And while the company being rescued from bankruptcy helps a lot of people, that's not a reason for anyone to buy shares of J.C. Penney.

The exterior of a J.C. Penney.

J.C. Penney is operating under bankruptcy protection. Image source: J.C. Penney.

Why is buying shares a bad idea?

When a company requests Chapter 11 bankruptcy protection that means it intends to continue operating. That's not always what happens. Sometimes the bankrupt company can't reach a deal with its creditors to continue (usually because those creditors think that they're better off with what they will get in liquidation than taking their chances of getting more if the company stays in business).

In a Chapter 11 filing, bondholders, unpaid creditors, lenders, and pretty much anyone or any institution the company owes money to gets consideration before the stockholders do. Usually, those stakeholders end up with more equity, and the company's stock either ceases to exist or the shares you own eventually come to represent a much smaller piece of the company.

If you buy J.C. Penney shares now, you're taking the very real risk that you're buying something that is worthless. Let's say, for example, that Simon and Brookfield agree to swap some rent owed to them in exchange for equity in the company. That equity will come at the expense of people holding shares.

To put it more bluntly, J.C. Penney finding a buyer does not preserve shareholders' equity. It saves the company but the debts that get paid are the secured ones and the ones the company needs to keep operating -- think lenders and vendors. Shareholder equity will at best get minimized and, in many cases, will get fully wiped out.

Chapter 11 does not necessarily mean a company is going out of business. It generally does mean that shareholders' equity will go away. Buying shares in a bankrupt company is like paying full price for a house that's on fire because you like the parts of it that have not burned yet. Sure, the flames may get put out and pieces may survive, but the risk of a wreck and the cost of repairs wipe out any value you may have had.

Be very wary of bankrupt companies

The people who tout buying shares of bankrupt companies are day traders or speculators playing a dangerous game. They're treating the stock market like a casino (and they'll lose money in the end like anyone who has a system playing roulette or a "magical" method of beating slot machines).

In many cases, the people trading in these stocks are trying to manipulate their share price to make short-term gains. That's not something an investor wants to get caught up in.

If you want to make money in the stock market, take a long-term, boring approach. Buy shares in good companies that you believe in and hold onto them for a very long time.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.