To everyone saying it would affect religion, it would. I don't think it would erase it as many people think it would, but rather destroy the fundamentalist, literal-interpretation train of thought that evolution doesn't exist, the earth isn't the center of the universe/flat, etc. etc.
There was a theory I heard about that was submitted to the Vatican that suggested that the human spirit could exist in hypothetical alien species, and that our earthly bodies are vessels used to help us learn and grow while having our earthly experience. Thus, the "aliens" we encountered would simply be humans living on another planet, experiencing a different type of "earthly experience" in a different vessel that had its own evolutionary course. This is HEAVILY re-interpreted from an offhand comment I heard, but that was the basic gist of it.
I'm not saying I personally subscribe to this theory, but the point I'm trying to make is that religion can find ways to accommodate modern science and even other intelligent life. It wouldn't go away, I think it would just adapt. Theologians aren't dumb. Which raises the age-old argument of humans changing religion to suit their agenda vs. accepting it as truth and trying to reconcile what they've learned with what God has told them, but that's another issue altogether.
Now that I went on that massive tangent, the "common enemy" thing is what I was thinking, yes. I don't think it's a good or right answer, but I think it's the most likely to happen. When you weigh differences between races, having scales or tentacles or whatever weird shit aliens might have is way more apparent than having a different skin color, so the "more different" race (with a completely different culture/technology to boot) would be way easier to segregate and view as the "other," which might diminish a sense of separateness between skin colors or slightly different (by comparison) cultures on Earth. I think it would take some time, but it might shift the majority of racism towards the aliens eventually.
More optimistically, the aliens would be peaceful and benevolent and help us reach enlightenment. Buuuut that's not likely to happen. I'd be very glad to be wrong about that, though.