LOS ANGELES -- On Stage 20 at Twentieth Century Fox studios, the scene was set for a confrontation. Standing in a full-size replica of the courtroom of the U.S. Supreme Court, an actor prepared to address nine people in black robes bearing uncanny resemblances to their real counterparts in Washington. Behind him, men and women in dark blue suits filled the rows of pewlike benches.

"Quiet! Same pickup," an assistant director said. And the cameras, suspending disbelief, focused on a small-town defense attorney asking the court to overturn his client's murder conviction. His argument: that police in Rome, Wis., had illegally preyed on his religious beliefs to elicit a confession without counsel present.

It was a big moment for character Douglas Wambaugh of the CBS television program "Picket Fences" and an example of the kind of conflict that has earned the show two consecutive Emmys for best dramatic television series.

Now in its third season, the Friday night program has brought to prime time an unmatched barrage of plots turning on fine points of religion, ethics and law. Of the 40-plus shows that have aired, at least one-fourth have been driven by plots and subplots with religious themes -- quite a track record in Hollywood, a town that has been notoriously uncomfortable with religion.

"If we're different from other shows, it isn't that we've accented religion, but we have not pretended that it's not there," said David E. Kelley, executive producer and primary writer. "We have recognized religion as a legitimate entity that enters people's lives. We've suggested it's not just the zealots, the nuts, that believe in God, but everyday people."

Along with everyday people, Kelley and his writers have created a community with as many quirky personalities and problems as any large city. Each episode is punctuated with at least one weighty moral issue: drugs in schools, modern-day Robin Hoods, integration, medically assisted suicides, abortion, AIDS, school prayer, serial killers and kinky sex. There are never clear answers, just questions and an almost obsessive presentation of arguments on all sides of every issue.

In an episode this spring, police discovered a closet full of women's shoes at the home of Father Barrett, the town's Catholic priest. The townspeople were forced to confront their own sexual predispositions as well as the issue of whether a man with a shoe fetish could be an effective clergyman. In the end, they voted to support him and asked the monsignor to let him stay.

Last year's Christmas special featured a 20-year-old woman who was comatose after driving her car into an icy lake. The doctors determined that she was four months pregnant, but also that she was a virgin. The possibility of another divine pregnancy had the local clergy scrambling for an appropriate response and the community divided over whether the pregnancy should be aborted to save the woman's life. The religious scare -- and anticipation -- ended when a gynecologist was arrested after admitting that he impregnated his patient with a hypodermic needle without her knowledge.

But as a personal issue, religion arises most often with the Brocks, the paradigmatic American family at the center of Rome and the series. Like many modern couples, Jimmy Brock, the town sheriff played by Tom Skerritt, and Jill Brock, a physician and sometime political candidate played by Kathy Baker, have trouble talking to their children about religion and even articulating their beliefs. That leaves the youngsters -- Kimberly, 18, Matthew, 13, and Zachary, 10 -- to fend for themselves.

In this season's premiere, Zach sues the school committee, on which both his parents sit, for allowing a teacher to suggest in class that creationism, the creation of the world and humanity by God, is not inconsistent with scientific evolution. Meanwhile, the police find the body of a 16-year-old girl who has been stabbed 23 times. Like his father, Zach wonders how God could allow such brutality.

Before Judge Henry Bone, in the courtroom where most episodes of "Picket Fences" end up, Zach calls God a joke and the teaching of creationism "Catholic dogma."

"That's the kind of insanity religion breeds," Jimmy Brock says.

"No, no," rejoins his wife, "this is the kind of insanity bad parenting breeds. Jimmy, I want to start taking them to church. I don't just mean funerals and Easter. I mean on a regular basis." The episode ends with the family standing in church singing the Doxology -- except for Jimmy Brock, who looks blankly toward the camera.

As an actor, Baker said, she finds the Brocks' religious struggle familiar "because I'm in the same place with my own family, searching for the right religious teachings in our lives. Jill is on the same journey. I can feel it strongly."

Baker, who was brought up Protestant, is married to a man who was raised Catholic. They have two boys, ages 4 and 9, and have felt the need to find a regular place of worship. They plan to go to different churches and synagogues until they find a place that feels right.

The show's combination of drama, introspection and offbeat humor seems to be working for Kelley, a veteran of "L.A. Law" and creator of "Chicago Hope," a new series on CBS. In addition to six Emmys in its first two seasons, "Picket Fences" has been given awards by the Viewers for Quality Television, Catholics in Media, the Alzheimer's Association and the National Easter Seal Society.

But not everyone has been enthralled. Michael Medved, host of "Sneak Previews" on PBS and an advocate for increased attention to organized religion in film and television, applauds the show's focus on religious issues but says it fails to provide balance -- as do most films and TV programs that address the subject.

Despite recent efforts by Hollywood to get in touch with mainstream America, where 40 percent of people attend worship services weekly, many in the industry still harbor religious prejudices, he said.

"Inevitably, you're dealing with people who are not terribly sympathetic to traditional religious faith," Medved said. So story lines usually present "secular people teaching something to the religious people" -- as when the fanatically religious doctor gets his comeuppance for going to such lengths to get people to "relive the possibility" of a virgin birth.

Some viewers have reacted negatively as well. A Mormon-owned station in Seattle temporarily banned the series after a story line on a Mormon bigamist; Christian Scientists were outraged when physician Jill Brock performed an emergency Caesarean section despite the family's protests; and Jewish viewers have objected to the ongoing portrayal of Wambaugh, a lawyer whose business card reads: "Reasonable doubt for a reasonable fee." One wrote a letter to the New York Times, saying that "some Jewish readers find the depiction of the unremittingly Jewish lawyer to be so repugnant as to be anti-Semitic."

Ironically, Fyvush Finkel, who portrays Wambaugh, is perhaps the most outwardly religious actor in the cast. "It hurt me when I read that letter, personally," said Finkel, who calls himself an Orthodox-Conservative Jew. He trained in the Yiddish Theater in New York and for 12 years toured with the first national company for "Fiddler on the Roof."

Kelley decided to answer the criticism with an episode for which Finkel won an Emmy this year for outstanding supporting actor. In the story, Wambaugh takes the podium at a temple memorial service and tells a racist joke about a Jew and an Indian at the gates of heaven. The rabbi bans him from the temple, and a devastated Wambaugh calls for a bet din, a religious court, to rule on his banishment. The court rules that the rabbi might condemn him as a man but "not as a Jew."

Wambaugh's crowning moment in the series comes when he realizes every litigator's dream of appearing before the Supreme Court, an episode scheduled to air Nov. 18.

The issue turns on a scene in the two-part premiere in which Officer Kenny Lacos approaches a murder defendant privately, "Catholic to Catholic." He calls on the defendant's Christian decency to reveal the location of the body so the girl can be buried. "Every Christian deserves that," he says.

The defendant tells Lacos, cryptically, about a pond outside town where a person might go to find peace. And there, of course, the police find the body.

Judge Bone, played by Ray Walston, realizes the police may have violated the defendant's constitutional rights by taking advantage of his religious beliefs. But he decides to move forward anyway: "I've got a novel idea. I'm going to hold that a person can be deeply religious and still be competent" to waive his right to an attorney.

"I don't give a damn what the Supreme Court says," Bone asserts. "I'm sick of the judicial system being more about winning and losing than it is about the truth. Mr. Lathem, you're going to trial. If the Supreme Court has a problem with that, they can come and get me."

With that, the stage is set for Wambaugh's presentation in Washington. While he argues that the police compromised the defendant's free will by invoking his religious beliefs, Jonathan Littleton, the district attorney, takes the position that legal protections regarding confessions are too absolutist and should be overturned. The episode ends with a ruling but, as usual, no resolution.

Don Cheadle, who plays the part of Littleton, said that even the cast didn't know from the script whether the defendant is innocent or guilty. "It's real tricky, and I guess that's why David wrote it," he said.