NEW YORK - It's long been an unwritten rule of political campaigns: The candidate's spouse is a cheerleader and a surrogate, but not an attacker. Yet there was Cindy McCain this month, introducing her husband at a Pennsylvania rally with an angry reference to Barack Obama and his vote against a bill funding the troops in Iraq.

"The day that Sen. Obama cast a vote to not fund my son when he was serving sent a cold chill through my body, let me tell you," she told the crowd.

It was a striking moment, not only because it was a direct attack, but because in other ways, John McCain's wife has taken a notably conservative role on the trail. Largely forgoing solo events, she's been seen day after day standing behind John McCain as he speaks, laughing at the well-worn jokes, applauding with the crowd, nodding her head in agreement.

By contrast, Michelle Obama campaigns on her own -- one rally in Gainesville, Fla., this month drew 11,000 people -- and rarely dovetails with her husband on the trail. She's gone on talk shows like Jon Stewart's "Daily Show," "Larry King Live" and "The View." She's boogeyed with Ellen DeGeneres, and told Jay Leno this week how much she'd come to like campaigning: "I enjoy it more than I ever thought I would," she said.

As a nearly two-year marathon draws to a close, the spouses provide a study in contrasts on the trail, in ways that go beyond the personal style differences of these two women -- one a 44-year-old law school graduate, hospital executive and mother of two young girls, the other a 54-year-old businesswoman, heiress, philanthropist and mother of four older children.

"Cindy McCain is pretty much a question mark as she's rarely left her husband's side," says Paul Costello, former press aide to both Kitty Dukakis and Rosalynn Carter. "She's chosen a very conservative approach. That is, in the modern era of spouses, quite uncommon."

A former aide to Vice President Al Gore, Chris Lehane, sees the difference in approach as "a combination of style, generational (divide) and party affiliation." He also speculates that Cindy McCain "appears to have been really scarred by the experience in the 2000 South Carolina primary," which John McCain lost to George W. Bush amid insinuations that he fathered an illegitimate child. The couple adopted a daughter, Bridget, from Bangladesh.

Indeed, Cindy McCain referred to that experience at a women's event a year ago, says historian Carl Anthony, and suggested that she'd protect herself better this time.

"She said, 'You know what? I'm not going to put it all on the line again,'" says Anthony, of the National First Ladies Library. "'It's not the be-all and the end-all.'"

Yet McCain has been nothing if not a tireless presence on the trail. And as her remark about Obama and troop funding showed, she hasn't shied away from expressing strong views. (In fact, Obama consistently voted for Iraq troop financing except on one occasion, in May 2007, because the proposed bill didn't also specify steps for a withdrawal.)

Another example: Earlier this month, when Democrats were accusing the Republicans of dirty campaigning, she turned the tables and told reporters that Obama had run "the dirtiest campaign in American history," according to The Tennessean newspaper.

While some suggest Cindy McCain is uncomfortable with the rough-and-tumble of campaigning, an aide says she's "having a great time" on the trail and has chosen to campaign with her husband because they're a great team.

"She's the perfect person to introduce him," says her communications director, Laurye Blackford. "She gives the family side of him. And the crowds at our rallies love her. They are as excited to see her as they are to see him."

Downside of non-stop campaigning

Candidates' spouses have been an important campaign presence since 1920, when Florence Harding spoke to women's groups from her front porch, says Anthony, the historian. Mamie Eisenhower was famous for her speeches from her husband's whistle-stop train. Pat Nixon and Jackie Kennedy both wrote articles boosting their husbands, and Lady Bird Johnson struck out on her own through the Deep South in 1964.

The downside of nonstop campaigning, of course, is that the more one speaks, the easier it is to make a gaffe -- recall Hillary Rodham Clinton's 1992 remark, "I suppose I could have stayed home and baked cookies and had teas" -- not her best spousal moment on the trail.

Michelle Obama is viewed as having become an increasingly effective and disciplined campaigner. She's moved away from an early tendency to describe her husband's morning breath or failure to put away the butter, and now focuses on parallels between her life and the concerns facing ordinary Americans and, particularly, military families.

Campaigning three or four days a week, she's made close to 50 appearances since the Democratic convention in August. But her schedule hasn't been as heavy as it could have been. She didn't start spending the night on the road until the summer of 2007 when her mom retired and could stay with Malia, 10, and Sasha, 7.

"She has focused first and foremost on balancing the responsibilities of the campaign trail with ensuring her children are happy and whole in their normal routine," says Katie McCormick Lelyveld, Obama's communications director.

Obama speaks freely about her kids, making sure to slip in anecdotes about how rooted they are in everyday childhood concerns. The moment she walked offstage after her big convention speech, she told DeGeneres, Malia had something important to say: Could she have a sleepover that night? And she told Leno that when the family was discussing Dad's 30-minute "infomercial," Malia asked with concern: "Are you going to mess with my TV?"

Whatever the spouse's approach to campaigning, it's clear it's not an easy life, and not for the uncommitted.

"It's hard work, to get up at 5 a.m. and have a smile pasted on your face for 14 hours a day," says Costello. "This is not for the faint of heart."

But no one can deny the role an effective spouse can play on the trail. "Presidential campaigns always come down to character comparisons," Lehane says. "And no one serves as a better validator of a candidate's character than their spouse."