FIVE years ago, Gary Frank decided to sell his bookstore here.
The Booksmith had built a fine reputation over a quarter of a century, thanks to an impressive series of author appearances and a high-traffic location in the old hippie neighborhood of Haight-Ashbury.
Yet hardly anyone expressed interest. Frank was disappointed but not surprised.
"Maybe they saw the future," he said.
A Clean Well-Lighted Place for Books, open since 1982 near City Hall, sought a buyer, couldn't find one, and closed last summer. Cody's Books shut its flagship Berkeley store after a half-century run. Black Oak Books closed one of its stores and is considering shutting the other two if a buyer can't be found. Numerous small new and secondhand stores have fallen with little fanfare.
The casualties are nationwide. Coliseum Books and Murder Ink in Manhattan shut down in recent weeks. Micawber Books in Princeton, N.J., couldn't make it. Dutton's 2-year-old outpost in Beverly Hills has closed, and the original Dutton's in Brentwood will be forced to shrink or relocate if the landlord carries through with plans to redevelop the site.
Rising rents and competition from the chains have imperiled independents for years, but San Francisco used to think it was immune. Cody's and other Bay Area stores helped spark the Beat movement, encouraged the counterculture, fueled the initial protests against the Vietnam War. In a region that sees itself as smart and civilized, bookshops were things to be cherished.
No longer, apparently. The stores that are still in business feel compelled to underline that fact.
"Rare but Not Extinct," one proclaimed in a holiday ad. Another, announcing a special sale in a leaflet, felt the need to emphasize, "We're not going out of business."
WHAT'S undermining the stores is a massive shift in buying habits brought about by the Internet. Ordering from Amazon.com, Frank said, has almost become the generic term for book buying.
Technology changes behavior, which reshapes the physical landscape. The era of repertory movie houses playing "Casablanca" and "High Noon" ended with the VCR. The telephone booth was replaced by the beeper, which was made obsolete by the cellphone. And the newspaper is under siege by the Internet's ability to recombine and distribute news without leaving ink on your hands.
"The bookstore as we know it is in dire straits," said Lewis Buzbee, a novelist who spent many years working in the local shops.
That sense of peril is doubtless one reason "The Yellow-Lighted Bookshop," Buzbee's loving memoir of his time as a clerk in the Bay Area interspersed with a history of the bookselling trade, has become a small but genuine hit. It's just gone into its fourth printing, with enthusiastic crowds flocking to the writer's appearances.
"One thing books do is offer us concrete definitions for sometimes hazy feelings," said Buzbee, 49. "My memoir gives people a venue for sharing their emotions about bookstores."
A good bookstore, he notes, is unlike any other retail space. Where else can you linger, sample the merchandise and then casually reject it if not quite right? Your local pizzeria would frown on such behavior. In a culture that worships money, bookstores are one of the few commercial institutions where cost doesn't trump all other considerations. Massive bestsellers share shelf space with the most obscure tomes.
Buzbee exalts a place where time seems to slow but hours can disappear in an instant, where browsers coexist in a companionable solitude, where a chance encounter with the exact right volume might create an explosion in your head.
"Not only could your world change, but the rest of the world could change," he told an audience at the venerable City Lights bookstore in North Beach.
It was a message that Kim Webster, an apartment concierge, heard and found eloquent. She said Buzbee captured "the essence, the nirvana feeling, the power of the written word."
But she didn't buy his $17 volume that night. Maybe later, she said, maybe from her local chain superstore. And if she missed it there, the Internet is an emporium that never closes.
THIS is the paradox of modern bookselling. Even in an entertainment-saturated age, people still buy books. But the casual reader has many other places to get bestsellers and topical books, from warehouse stores to the mall. Meanwhile, book nuts -- the ones who simply must buy several volumes a week -- are lured online. Few businesses can survive that lose customers from both ends of the spectrum.
In 1995, anyone seeking a book that was the least bit uncommon had to have a store special order it from the publisher. If it was out of print, the would-be reader needed to trudge to the local secondhand shop, which would run a classified advertisement in AB Bookman's Weekly, a magazine that circulated among book dealers. It was a hit-or-miss proposition.
AB Bookman's Weekly went out of business in late 1999, an early Internet casualty. There are now half a dozen major Internet search engines that specialize in books. On one of them, AbeBooks.com, there are 44 copies of "The Yellow-Lighted Bookshop."
It's hard for any single used bookstore to compete against this bounty, just as it's impossible for any shop carrying new books to rival the electronic plenitude of Amazon. Because the Internet retailer doesn't have to pay rent for display space or charge sales tax, its books are almost invariably cheaper too.
"I'd be really hard pressed to come up with a single social or demographic trend that is in favor of bookstores," said Tom Haydon, whose Wessex Books in Menlo Park was for decades the best secondhand store in the 50-mile stretch between San Francisco and San Jose.
Unable to find a buyer, Haydon closed Wessex in June 2005.
"It's a lost cause," he said.
During the 1990s, when the biggest threat facing independents was the Barnes & Noble and Borders chains, there was outrage and action. In Capitola, a full-size Borders store was voted down by the City Council in 1999. When a Borders opened a few miles away in Santa Cruz the next year, it was greeted by demonstrators and hecklers.
But in the last year or two, as the menace from the Internet became palpable, the chains lost their position as No. 1 villain. Borders and Barnes & Noble reported that sales in stores open for more than a year slipped over the Christmas holidays, despite the healthy economy.
Meanwhile, Amazon reported "media" sales (which include books) in North America of $1.25 billion for the last three months of 2006, a 21% increase over the same period a year earlier.
"The purpose of a business is to satisfy the needs and wants of a customer," said book industry consultant Albert Greco. "That's what the online world has done."
MAYBE that's why passions among literary folk now seem so muted.
When sliding sales forced Cody's to close its store next to the UC Berkeley campus, the poet Ron Silliman wrote on his blog that it was once the anchor of "the best book-buying block in North America." But in the discussion that followed, the attitude was one of resignation if not indifference.
"Why would anyone want to perpetuate small independents by paying higher prices?" wondered Curtis Faville, a poet who sells rare books on the Internet. "Most of these proud little independents were poorly run anyway."
Less harshly, Silliman suggested in an e-mail that "we're simultaneously caught in the wonder of the new and true mourning for the losses of the old."
It's an unsettling if inevitable process. Half a century ago, Silliman said, he would play chess and checkers with his grandfather as they listened to the radio. "That stopped once the TV arrived, because now we all had to face the same direction," he wrote.
Those for whom "browsing" has much more of an online connotation than a physical one barely register the shift.
"Bookstores, small or large, don't carry what I'm looking for," said Logan Ryan Smith, a 29-year-old accountant who publishes a literary magazine and poetry pamphlets. "I'm not going to find an Effing Press or Ugly Duckling Presse book even at City Lights or Cody's."
Smith is a beneficiary of what Chris Anderson, editor of Wired magazine, has dubbed "the Long Tail."
The Internet has transformed American culture from a place where a few sold the same thing to many -- think network television or the Hollywood studios or even booksellers circa 1970 -- to one where the middleman or gatekeeper can be circumvented.
The humblest band, the most amateur moviemaker and the clunkiest poet now have at least a hope of finding fans, and of having fans find them. When diagramed on a chart, this new marketplace resembles a tail extending into infinity.
"The clear lesson of the Long Tail is that more choice is better," Anderson said. "Since bookstores can't compete on choice, many once-cherished stores are going to be road kill."
Not that he thinks this is a big deal.
"A lot of our affection for bookstores is based on a romanticized notion," Anderson said. "The fact that we're not patronizing them speaks more loudly than our words."
Buzbee, who does patronize them, is determined to be hopeful.
"I don't know whether pulling our hair out and bemoaning our fate does any good," he said. "Technology is here to stay, but I firmly believe that we will still have better things to do than sit in front of a computer."
The bookstores Buzbee worked in, Upstart Crow and Printer's Inc., are long gone. The shop where he now feels most at home is the Booksmith. "The perfect urban bookstore," he calls it in "The Yellow-Lighted Bookshop."
Last fall, a weary Frank was contemplating closing the 11-employee store when he finally received a solid offer. A few weeks ago, he signed a tentative agreement to sell the Booksmith for a mid-six-figure price to a partnership led by Praveen Madan, whose previous career involved steering tech firms to profitability.
Madan, 41, calls bookstore owners "reluctant capitalists," saying they're suffering because they haven't innovated. His goal: "Create the store for the 21st century. If you do it well, you'll give customers a reason to come back. But you can't do it by making them feel guilty."
He's full of plans for improving the Booksmith's website, tying the store more firmly to the Haight-Ashbury community, doing more events -- making it both inescapable and irresistible for those who live in the neighborhood.
Frank, who owns the Booksmith building, is helping out the new team by offering a below-market rent. He couldn't think offhand of a store anywhere in the country that has successfully reinvented itself and moved to a secure financial footing, but that doesn't mean it's impossible.
"Someone needs to take bookstores to another level," Frank said. "Because this level sure isn't working."