THE CREDIT CARD is a marvelous invention. It permits you to walk into stores, sign your name and leave with goods. But the convenience of that arrangement is not free. Somebody has to pay for it. That's why the Maryland legislature is wrong in rushing to pass a bill barring banks and retail stores from charging membership fees for their credit cards.The bill seems to rest on the assumption that everyone -- not just card users -- should pay.

Typically, a company that issues credit cards covers its expenses and makes a profit by collecting interest on bills not paid within a month and by pocketing 5 percent to 10 percent of the money it collects. That means the merchant who sells a product for $10 gets only $9 to $9.50 from the credit card company. That, in turn, means the merchant either absorbs the loss -- offset by the costs he no longer incurs in running his own credit system and pursuing bad checks -- or passes it along in higher prices. When stores do the latter, and many do, every customer pays the higher price for the convenience only the credit card users enjoy.

Resistance to this system has been building for some time, and that partially explains why credit card companies are moving toward membership fees. In the Washington area, for example, some stores now offer discounts of up to 10 percent to customers who pay cash. Even more stores belong to that unusual card system in which a percentage of the bill is deposited in the savings account of the cash customer. The merchant gets the same amount of money or, perhaps, more, and the customer, instead of the credit card company, gets the 5 percent or 10 percent.

It may be, as members of the Maryland legislature seem to think, that credit card companies are making out like bandits because of the interest rate they charge on deferred payments. But that is an excuse, not a reason, for attacking the membership fee system.

Ideally, the costs of credit cards should be paid only by those who use them. That requires -- assuming legitimate regulation of interest rates -- either membership fees or a steadily increasing two-tier price system. The former would be preferable for both stores and customers, but it isn't going to come about as long as the myth persists, as it does in Annapolis, that credit cards are, and by nature should be, free.