She was a lonesome, only child. Books were her friends. But in the Oregon of the 1920s when she was young, most library books for children were frontier stories or about wealthy English children.

"They had ponies to ride," she recalls. "We knew only plowhorses."

When she grew up, she remembered that lesson of her childhood and wrote books "about ordinary kids like we'd been."

There are 26 of those books now, all still in print, written during 30 years. They've sold 3 1/2 million hardcover copies, millions more in paperback, won batches of prizes and made Beverly Cleary one of the most widely read children's authors in the United States.

Characters like Henry Huggins, Otis Spofford, Beezus and Ramona, Ellen Tebbits, Ralph S. Mouse and Socks the cat have become the intimate companions of two generations of young readers.

Although there is more violence, divorce and disruption now than in Cleary's childhood, "the concerns and needs," she says, "remain basically the same. Much that is true of life today was also true of life in the days of my girlhood.

"Many children's letters today make me think of the 1920s. Children write me of their fathers, their whole communities, being out of work."

Such letters--sometimes 100 a day--bring back the dark, unsettling days when her own father lost his job during the pre-Depression inflation of the 1920s. "On our street there were many tensions, much uneasiness."

Cleary has transmuted these and other childhood memories into her compassionate and comic Ramona tales, in which the heroine is one of the best known and empathic in contemporary children's fiction.

Through good times and bad, Ramona and her family (the Quimbys) cling together, survive intact and love each other.

"Kids tell me that my books make them feel better, give them a sense of security," says Cleary. "They also tell me that it is comforting that the Quimbys can't buy everything they want. Half the kids in the country seem to have kid brothers and sisters they call Ramona."

The author, who was in Washington recently to lead off "Children's Literature Today," a series of lectures sponsored by the Smithsonian Resident Associates, finds much that is amusing in the everyday dramas of life. The humor in her books is a quality she remembers longing for in those of her youth.

Her mother had been a school teacher who went West to teach homesteading families in a small Oregon farming village without a library. She told her daughter every poem, story, folk and fairy tale she could remember.

Eventually, the family moved to Portland, where at last there was the longed-for library. Perhaps it was only natural that Cleary would grow up to become a children's librarian (in Yakima, Wash.), where she discovered she had a knack for telling stories to kids.

Her favorites were the third- and fourth-graders. "They were so eager, so interested, and they could read. By sixth grade, kids felt the need to be blase', cool."

It was during this period in her life that she realized there was a major gap in books for young children: Nothing had been written for a group of rambunctious, bright but non-reading little boys who were herded into the library one day by an exasperated teacher. " 'We want stories about kids like us,' " they announced.

"I was haunted for years by those boys in Yakima," says Cleary. The eventual result: the Henry Huggins books, numbering five. Six, if you count Ribsy, the adventures of Henry's loving mutt. "I wrote them all for those little boys in Yakima."

Cleary adds with a bit of pride that many children tell her Henry Huggins is their first "chapter" book.

Since she had been an only child, it was her own children, twins now 27, who provided a living laboratory in which Cleary gained first-hand knowledge of how small children interact. Her daughter is a cellist; her son an economist and world-class runner.

It was for her young son that Cleary wrote the books about Ralph, the mouse who drives a toy motorcycle. Children understand instinctively how Ralph starts the motorcycle by making the appropriate noises: "pb-pb-p-p."

Cleary's fan mail inspired her newest book, Dear Mr. Henshaw (to be published this fall). The story traces--through a grade-school boy's letters to his favorite author--the pain and growth resulting from his parents' divorce.

"In the past three or four years," says Cleary, "an increasing number of letters have asked me to write a book about someone, usually a boy, whose parents are divorced. There's a wistful quality to these letters, a longing for fathers."

One child wrote, "My father ran away, now it is just my mother, my brother and me."

The book also gives Cleary a chance to answer a question posed often in her young readers' letters: How do I become a writer?

There's lots of good advice on this topic: Read, look, listen, think and write, keep a diary, don't try to write fiction until you're older.

Although Cleary used to answer all her letters, the numbers became overwhelming. Now "only those from the heart" get a personal reply. "I have a drawerful of special letters to read in my old age, letters from kids, librarians and teachers."

One of the most meaningful was from a girl whose parents are divorced and whose mother works the night shift: "Your characters," wrote the girl, "have helped me through long, lonely nights."

"Farm children," says Cleary, "write the most interesting letters, about helping their fathers, working the crop. Urban children say nothing about their environment. City kids write that they wished they lived in Henry Huggins neighborhood."

Cleary, 66, has won buckets of awards, particularly those for which children vote. Recently, she was named U.S. nominee for the prestigious 1984 Hans Christian Andersen Medal, which recognizes an author's entire body of work.

About the coveted Newbery Medal, however, which has eluded her, she speculates that "humorous books for younger children are not often considered as literary or elevating as more serious books."

Cleary lives in Carmel, Calif., with her husband, Clarence, a retired accountant. Calling libraries "the safehold of childhood," she travels often to library conferences. Yet at a recent conference, "all I heard was hardware and software," she laments. "No one mentioned books, once."

What books does Cleary advise children to read? "Anything they want, with guidance."

Particular recommendations: fairy and folk tales "which help kids get at all sorts of emotions symbolically."

A letter from a young reader sums up Cleary's lifelong philosophy. "We have so much," wrote the girl, "when we have books to read."