People of the same race share genetically transmitted physical characteristics. People of the same ethnicity share cultural, linguistic, religious, and often racial characteristics.
Ethnicity is broader and more useful. Racial classifications have often been imposed by outsiders, and many of the traditional classifications are now regarded as questionable from a scientific standpoint. As a result, race is more vague and less intellectually sound than ethnicity. Of course, in real-world usage, race is usually just a polite term for skin color.
Both words require caution. When used imprecisely, they tend to betray cultural biases.
Race carries heavy historical baggage and is almost always used in reference, direct or indirect, to historical racial struggles, modern racial inequalities, or culturally constructed racial identity—for example:
Though Barack Obama never made his race a part of his presidency, he has become a national Rorschach test on the topic just by being. [NPR]
[H]is good old boy Southern persona and impolitic remarks about race presented problems. [Telegraph]
The one radical thing about Barack Obama is his race, his name. [New Yorker]
Ethnicity is less thorny, and it’s generally more acceptable than race for describing a group of people. For example, race would create at least a slightly different meaning than ethnicity in these instances:
His comparison of “Chinese” versus “Canadian” culture and his perplexing preoccupation with details of ethnicity might be belied by his background. [Vancouver Sun (now offline)]
The crowd, diverse in both age and ethnicity, waved American flags, snapped cell phone pictures of the scene. [Star-Ledger]
The footpath ahead was thick with hikers of every shape, size, age and ethnicity. [Guardian]