You can run loglinear analysis. Check out Andy Field's Disovering Statistics Using R. He has an entire section on this in Chapter 18. A chi square test of independence is an extension/derived from loglinear analysis such that a chi square test tests for a two way interaction between your two categorical variables. If a chi square test is significant, that implies a significant two way interaction between your categorical variables and therefore, are not independent (that's how the chi square test of "independence" gets its name). You can extend loglinear analysis to include three variables so that you can test for a relationship between three categorical variables. You basically start off with a saturated model that includes all of your 3 main effects, 3 two way interactions, and a single 3 way interaction. You then remove the three way interaction from the model and then compare the saturated model to the new model using a likelihood ratio test (basically comparing the deviance of the new model to the deviance of the previous model). If the likelihood ratio test is a significant, then you can say that there is a significant three way interaction between your categorical variables. You can then stratify your data using the levels of one of your categorical variables (which categorical variable you choose depends on what you find is interesting) and follow up with two separate chi square test of independence.
(I just realized this question is from a few year past. Anyways, I hope this offers clarification nevertheless).