And if it's anything racist, sexist or inappropriate in any way, tell them so, and why.
If it is an ethnic joke, ignore it and look at them without laughing, or tell them you don't find ethnic jokes funny.
You can "remember" you need to make a phone call, then jump up and leave the area and avoid the situation.