Not sure about this specific mission but I think we have had satellites around mars in the past that have helped relay messages when line of sight isn't available.
Edit: Link (communications): http://en.wikipedia.org/wiki/Curiosity_rover#Specifications