He said he would "support a constitutional amendment which would honour marriage between a man and a woman, codify that".
The issue of gay marriage seems likely to become an important issue in the next year's presidential election, because of the the US supreme court's decision in June to repeal the anti-sodomy laws and the Massachussett's supreme court's ruling in favour of gay marriage last month.
The Christian right, fearing that these rulings could eventually make gay marriage legal nationally, responded by calling for a change to the constitution endorsing only heterosexual marriage and effectively denying official recognition to same-sex couples.
To change the constitution they will need a two-thirds majority in both houses of Congress and then the support of three-quarters of the states.
Mr Bush has voiced his opposition to gay marriage before, but until now he has refused to back a change to the constitution, trying to maintain a fine line between indulging the prejudices of his political base in the Christian right and scaring off swing voters.
But in a television interview on Tuesday night he offered qualified support for a constitutional amendment, and criticised the Massachusetts supreme court for overstepping its jurisdiction.
The issue should be left to states to decide, he said. "The position of this administration is that whatever legal arrangements people want to make, they're allowed to make, so long as it's embraced by the state or at the state level.
"Except and unless judicial rulings undermine the sanctity of marriage; in which case we may need a constitutional amendment.
"The [Massachusetts] court, I thought, overreached its bounds as a court," he said. "It did the job of the legislature. It was a very activist court in making the decision it made."
Gay rights groups reacted angrily to the suggestion that the president might lend his name to a amendment which they believe is designed to specifically exclude them.
"It is never necessary to insert prejudice and discrimination into the US constitution, a document that has a proud history of being used to expand an individual's liberty and freedom, not to take them away," said Winnie Stachelberg, political director of the Human Rights Campaign.
The spokeswoman for the National Gay and Lesbian Task Force, Roberta Sklar, told the New York Times: "If he endorses amendments such as this, which blatantly discriminates against a class of people, you would then have to wonder who and what is next."
Nonetheless, Christian conservatives believe he has still not gone far enough, since his statements still gave the states leeway to allow gay couples some of the rights enjoyed by heterosexuals.
Tony Perkins, president of the rightwing Family Research Council, said Mr Bush's statement "sounds as though the administration would support civil unions, which are counterfeits of the institution of marriage".
The opinion polls suggest that Americans are inclined to give lesbians and gays legal rights as couples but not the right to marry; 42% favouring a legal ban on gay marriages.