Well Nexium is a Proton Pump Inhibitor and Ranitidine is a H2- receptor antagonist, which means they doe the same job but at different parts of the process. There is no huge risks, but why spend money on both drugs when the Dr could simply increase the dose of one?
It is not a good idea to take both drugs together. They both act towards the same purpose - reduction of stomach acid. Some acid is necessary for digestion of food.