IT’S true: Sue Sylvester is a man.  Behind most great comedic actors, the saying goes, there is a great comedic writer. Will Ferrell has Adam McKay. Jack Lemmon had Billy Wilder. And Jane Lynch, who won an Emmy Award last month for her portrayal of Sue Sylvester, the acid-spewing, narcissism-redefining cheerleading coach on “Glee,” has Ian Brennan.  It was the 32-year-old Mr. Brennan, for instance, who wrote the classic Sue zinger: “You think this is hard? I’m passing a gallstone as we speak. That is hard!”  And this oh-so-subtle put-down, said to one glee club student: “So you like show tunes. It doesn’t mean you’re gay. It just means you’re awful.”  One of Ms. Lynch’s favorite Sue lines — again, written by Mr. Brennan — involves a threat, this time to her main nemesis, the glee-club director Will Schuester (Matthew Morrison): “I will go to the animal shelter and get you a kitty cat. I will let you fall in love with that kitty cat. And then on some dark, cold night I will steal away into your house and punch you in the face.”  Ms. Lynch said: “Ian is this incredibly nice, incredibly sweet guy who just happens to have a really cruel, supremely mean sense of humor. I think it has something to do with growing up Irish Catholic.”  When it comes to writing “Glee,” the hit musical comedy on Fox, the three creators of the show — Mr. Brennan, Ryan Murphy and Brad Falchuk — each play a different role. Mr. Murphy, the director of “Eat Pray Love” whose television work includes “Nip/Tuck,” picks the songs and comes up with some of the crazier story lines, like football players dancing in formation to Beyoncé’s “Single Ladies (Put a Ring on It).” Mr. Falchuk, a “Nip/Tuck” alumnus, generally handles the scenes that jerk tears.  Mr. Brennan — who never had a professional writing job before — is a one-man one-liner factory, in particular writing the majority of the dialogue for the megalomaniacal Sue. The Web is overflowing with lists of his quips, with no compilation complete without this one: “I’m going to ask you to smell your armpits. That’s the smell of failure, and it’s stinking up my office.”  How does he come up with this stuff?  “It honestly just kind of flows out, kind of in aria form, and I have to whittle the writing down to something usable,” Mr. Brennan said while curled up on a sofa in the “Glee” production offices on the Paramount Pictures lot here. “It’s just the mean things that pop into the back of your mind that you sometimes want to say but don’t. The difference is that Sue actually says it.”  Mr. Murphy likened Mr. Brennan to a human sponge.  “Ian is a big collector of detritus — ideas and words and observations that he thinks might be useful,” he said. “He writes them all down. I call it the magic book.”  Mr. Brennan insisted that Coach Sylvester’s attitude is not based on a real person, but conceded, after some pressing, that the prickly Mr. Murphy is sometimes a muse. “Sometimes if I get stuck, I’ll think, ‘What would Ryan say in one of his really mean moments?’ ”  It is clear that some of Mr. Brennan’s inspiration comes from himself. One of the running gags on “Glee” involves Sue’s hatred of curly hair. (“I don’t trust a man with curly hair,”Mr. Brennan had her say in one episode. “I can’t help picturing small birds lying sulfurous eggs in there, and I find it disgusting.”) Mr. Brennan has a love-hate relationship with his own long, wavy locks — something that started after an encounter with Stephen Sondheim.  After college Mr. Brennan was cast in a Chicago production of Mr. Sondheim’s “Saturday Night.” Watching a rehearsal, Mr. Sondheim commented on Mr. Brennan to the stage manager, “He’s one haircut away from being attractive.”  Writing was never a dream for Mr. Brennan. Growing up in the Chicago suburb of Mount Prospect, Ill., Mr. Brennan had his heart set on acting. In junior high he got the lead in a community production. During high school he was in competitive speech and drama, and also joined the show choir, grudgingly, because he thought he needed to learn how to sing and dance if he was going to make it big. “God, those sequins were awful,” he said, recalling the choir costumes.  After attending Loyola University Chicago he toiled as an actor in Chicago for a few years, ultimately landing parts in Steppenwolf Theater Company and Goodman Theater productions. Then came some bit television roles in New York.  All that time, however, Mr. Brennan couldn’t shake his show-choir experience. So, in 2005, he bought “Screenwriting for Dummies” and wrote a first draft of “Glee,” then conceived as a biting, cynical film along the lines of “The Virgin Suicides.” He shopped it around and got nowhere.  Then fate struck. A friend of Mr. Brennan’s in Los Angeles was a member of the same gym as Mr. Murphy. The friend passed Mr. Brennan’s script to him. A year of rewrites later, “Glee” was born as a television musical comedy.  About 12 million people each week now watch the series, which has spawned hit CDs, a concert tour and a robust apparel business — and may be turned into a Broadway show.  “The big learning curve has been figuring out how to deal with the anxiety,” Mr. Brennan said of his first full-time writing job. “You have a script deadline and this enormous operation depending on you and — sorry! — you have no ideas.” He also frets about the attention he has received, particularly when it comes to his older sister, Sarah Brennan, who is a founder of a charter school in a rough Chicago neighborhood. “I feel guilty that she works so hard doing something important, and I’m the one getting noticed,” he said.  Mr. Brennan remains close to his parents, who were visiting the “Glee” set in early October.  “I just let him be himself,” said his father, John Brennan, a former priest. “I can’t take any credit for his talent,”  With more than a hint of sarcasm, Charman Brennan, a middle school math teacher, said: “What about the brilliant mother? Feel free to leave her out.”  John Brennan added: “Ian has always been a character. His preschool teacher told us that he was the only one who got her jokes.”  A character indeed. Ian Brennan, who is between girlfriends at the moment, is a chatterbox with a habit of talking with his fingers outstretched in front of him, as if he were manipulating marionettes. He has an unusual fashion sense, piecing together vintage-shop polyester with street-vendor jewelry in a look he calls “70s tennis eccentric.” (“It’s almost like he wears little costumes,” Ms. Lynch said.) In general Mr. Brennan has a hard time sitting still.  “It’s kind of rodentlike, isn’t it?” he said. “Can’t you picture me grabbing a nut and scrambling up the wall?”  He stuck with the metaphor over the course of several hours on the Paramount lot, where “Glee” is taped on three soundstages. On the show’s choir-room set, Mr. Brennan leaned backward against a grand piano and startled himself by playing a chord.  “It’s my tail,” he said. “I just finished playing a sonata with my tail.”
Ian Brennan is the âGleeâ writer who gives Jane Lynch the nasty lines for her character, Sue Sylvester.