If the enemy mage gets Void Staff, you should still build a decent amount of MR but you should really focus on getting health. When someone has % magic penetration/reduction, the more MR you have the more MR they will penetrate, so the value of MR is generally less than the cost. This also applies when fighting enemies that have % magic reduction in their kit, like Nidalee and Kayle. They are best countered by large amounts of health (unless of course Kayle gets Madred's Bloodrazor). Warmog's Armor, Banshee's Veil, Soul Shroud, Frozen Mallet, Rod of Ages, and Crystal Scepter are all great items to get to counter Void Staff mages.
Note: Enemies like Malzahar and Brand, who have % of health magic damage, are especially dangerous when they get Void Staff because they cannot be countered very well by either MR or health. In that case, get Banshee's Veil because it will just negate one of their spells completely.
Now if your enemy grabs Sorcerer's Shoes + Haunting Guise, Malady, and/or Abyssal Scepter, then you should build as much MR as possible. These items give flat magic penetration/reduction, which is only good against enemies with low MR, and the more MR you get the less threatening this magic penetration/reduction will be. You should also build MR when fighting Amumu, Fiddlesticks, Ryze, Soraka, and any other enemies that have flat magic reduction in their kit. If you do the math, these champions are actually countered by MR items more strongly than champions who don't have any flat magic reduction in their kit.