Karen Shanle, a 29-year-old Illinois mother of three, broke out screaming. Andrew Tegerides, a 51-year-old New York restaurant owner, did a little Greek dance. Robert Mazurek, a 43-year-old Chicago pharmacist, just smiled.

"Well, what would you do if you won a million dollars?" asks Michael Pavitch, a 67-year-old retired construction worker who "jumped right off the stage" when he won $50,000 a year for 20 years in the Illinois state lottery. "It was one of the greatest moments in my life."

Like these four lucky people, several hundred Americans now have become "overnight millionaires" through the rapidly expanding network of state-run lotteries. Today the District launches its instant lottery and expects to announce its first millionaire by the end of the year.

If D.C. were a state, it would be the 16th in the country to adopt a legal lottery as a money-making device. At least two more states -- Washington and Colorado -- are scheduled to have lotteries by early next year.

Lotteries have a particularly great appeal in harsh economic times, says psychiatrist Robert Custer, who has run treatment programs for compulsive gamblers at the Veteran's Administration Hospital.

"Unlike games such as black jack or craps," he says, "a lottery is a dream game with a small investment. Someone with a small income can lose a $1 and not complain.When things are tough, people need a little hope."

The games are also popular with revenue-hungry states crunched by federal cutbacks and inflation, says John Quinn, executive director of the New York State Lottery and president of the National Association of State Lotteries.

"Like Thomas Jefferson said, "Lotteries are wonderful because they lay the tax only on the willing,"" Quinn says. "I foresee that in the next 10 years we'll have eight to 10 more states on board."

Although lottery players come in "all ages, income levels and ethnic groups," he says, "the typical player is a white, male blue-collar worker, around 50 years old with an income in the range of $20,000."

And in a time when this group has been particularly hard-hit by economic pressures, the lottery business is booming.

"New York had a tremendous year last year," says Quinn. "Sales and revenues were up 77 percent from the previous year." According to Public Gaming Magazine, "The highly lucrative state lottery business generated combined gross sales of $3 billion in the U.S. in 1981, with the net return to states totaling approximately $1.2 billion."

Lotteries usually follow one of three game plans -- passive, instant and player choice -- says Dan Bower, president of Scientific Games, Inc., of Atlanta, which will co-run the District's lottery with the D.C. firm Games Production, Inc. "The earliest of the recent state lotteries were played as weekly or monthly games where you bought a ticket and waited for a drawing to see if you won. Passive lotteries were successful at first, but they weren't very exciting so sales began to dwindle."

When Scientific Games developed the "instant lottery" in 1974 -- using a "rub-and-reveal" ticket for an immediate win, he says they soon edged out most passive games.

The District's lottery will be a typical instant game. Each $1 ticket has six rectangular latex-covered boxes that can be rubbed off with the edge of a coin to reveal dollar amounts below. The ticket is a winner if three like amounts appear. "Instant" prizes range from $2 to $10,000, with those winning $100 eligible for the grand prize drawing of $1 million.

Lottery officials expect the game to bring about $3 million -- 30 percent of the expected total revenue -- into the city treasury. About 46 percent of the gross receipts will go to prizes, and no District tax will be levied on winnings.

Unlike passive or instant lotteries, player selection games -- sometimes called "legal numbers games" -- allow the ticket purchaser to choose numbers on which to bet. For some, this element of choice adds to the excitement, and a great deal of folklore surrounds the selection of numbers. In New York, newsstands sell "dream books" that profess to interpret which numbers will be lucky, depending on your dreams.

"If you dream about a baby you're supposed to pick 1-2-3, according to the dream book," says Sherry Harrington of the New York State Lottery. "The devil is 6-6-6." The most popular number, she says, is 1-2-5, which corresponds to Christmas Day and the main street in Harlem.

These attempts to derive meaning from chance events are examples of "magical thinking," says psychologist Durand F. Jcabos, chief of psychiatric services at the Veterna's Hospital in Loma Linda, Calif., and an expert on addictive gambling.

"Gambling itself is an exercise in magical thinking, which is similar to the way children think. Because they want something so much they think it will happen. An example would be someone who thinks, "When I woke up the sun was shining right through my window and onto my wallet so that means my wallet will be filled if I buy a lottery ticket."

"Often their needs so override their reality-testing mechanisms that they'll mentally set aside the logic of the odds. They think, "If there's one chance in a million, I'm it.""

Among the "magical thought" revealed by lottery millionaires:

* Andrew Tegerides picked his $5 million New York State lottery ticket numbers, 7-12-15-18-34-39, because seven is a lucky number, 12 and 18 are the month and day he was born, 15 is is age backwards, 34 is his wife's age backwards and 39 is Jack Benny's age.

* Robert Mazurek said he was sure he'd win $1 million in the Illinois lottery when he appeared for the drawing and noticed that the holiday decoration on the stage matched the one on the front door of his home.

* Michael Pavitch usually bought his lottery tickets on Friday at one of two "lucky stores." But one rainy Monday when he "couldn't do much else anyhow," he drove to one store to buy a ticket he "had a hunch would be real lucky." It won him $100, and later the million-dollar prize.

Someone who buys a lottery ticket, Jacobs says, "has already started fantasizing about what will happen when -- not if, but when -- they win. Often there will be benevolent, altruistic thinking, such as promising themselves to give part of the money to charity. People tend to do that, because they think it will enhance their chances of winning and also because most people want to do good things for the people they love."

Eighty percent of all people gamble in some way, says Jacobs, "whether it's flipping a coin to see who buys coffee or getting heavily involved at the track."

Gamblers, he says, fall into one of "three levels of indulgence" in gambling. Most people, he says, are "users who gamble in some way recreationally or socially. It's a casual thing, like entering a church raffle, and they never gamble more than they're willing to lose."

By contrast, abusers spend "a disproportionate amount of money on gambling. There is a desperate note to their gambling. They're looking for a quick win, the magic button." The third group, addictive gamblers, "are looking for another way of life. They're attracted to the games that have spectators, like the casino or racetrack, where they can be looked up to and admired as a big winner."

A little gambling can be a positive experience, Jacobs believes, "if you're not using the money you need for food and other necessities. It can be a harmless recreational activity and a good exercise in fantasy. In rough times a little bit of fantasy can be healthy."