Joanne - Fortunately, that last is not true for the feds at least. The federal government considers the marriage contract to be permanently set at the time it was signed, meaning that if the genders were non-matching at that time, subsequent transition does not invalidate the marriage*. (However, this is federal policy and not yet enshrined in law. It's always possible for them to pass a law which changes things.) The couple may end up fighting with various bureaucracies who don't realize this, but it IS a valid marriage.
My guess is that in it would be hideously complicated in a state that doesn't recognize same-sex marriage, yes. (My wife and I have been very lucky that both our state of origin and state of employment legalized same-sex marriage, so we haven't had to worry about it. Although my wife still hasn't changed her birth certificate because *our* specific marriage license doesn't list a gender field at all, which makes that BC the only proof that she was male at the time.) Presumably federal policy and inertia would work in one's favor, but it probably would be a problem every time a bigot or a hopelessly confused bureaucrat got involved.
Of course, the reverse is also true - if the genders matched at the time of signing the marriage license, it's federally considered a same-sex marriage and invalid. That gets really tricky, since I'm not sure how someone who married and then transitioned in a same-sex marriage state (ie, their marriage is state-legal but federally-invalid) would go about getting re-married. They'd be married in some contexts and not others, which makes getting a divorce difficult even if they did want to go that far in order to re-marry correctly!
*
http://www.opm.gov/diversity/transgender/guidance.asp "If the employees in transition are validly married at the time of the transition, the transition does not affect the validity of that marriage, and spousal coverage should be extended or continued even though the employee in transition has a new name and gender."