LOS ANGELES  Hollywood could get used to this recession thing.

While much of the economy is teetering between bust and bailout, the movie industry has been startled by a box-office surge that has little precedent in the modern era. Suddenly it seems as if everyone is going to the movies, with ticket sales this year up 17.5 percent, to $1.7 billion, according to Media by Numbers, a box-office tracking company.

And it is not just because ticket prices are higher. Attendance has also jumped, by nearly 16 percent. If that pace continues through the year, it would amount to the biggest box-office surge in at least two decades.

Americans, for the moment, just want to hide in a very dark place, said Martin Kaplan, the director of the Norman Lear Center for the study of entertainment and society at the University of Southern California.

“It’s not rocket science,” he said. “People want to forget their troubles, and they want to be with other people.”