Spain's borrowing costs have soared, bringing the country dangerously close to being shut out of the bond markets even after eurozone partners promised aid for its ailing banks and Rajoy announced a new austerity plan last week.
Much smaller Portugal has already been rescued, to the tune of €78 billion, and is slowly winning back some investor confidence, slashing its budget and privatising state companies under close monitoring by a troika of the European Central Bank, the European Commission and the International Monetary Fund.
Both countries are ruled by centre-right governments that enjoy strong majorities in parliament after voters fed up with economic crisis threw out the previous Socialist governments.
But there the similarity ends.
Similar problems, different approaches
Portuguese Prime Minister Pedro Passos Coelho and his ministers have adopted a tough neo-liberal mantra while Rajoy began by striking a defiant, nationalist tone and sending mixed messages to markets about how he would tackle problems in Spain's banks, budget deficit and overspending regions.
Rajoy dragged his feet in taking some early measures, denied any need for outside assistance for the banks until the last minute, then left ministers to make the unpopular announcements.
"Mariano Rajoy has done good things. If you look at the substance, it goes pretty far but it is true that the communication has not always been a success," said Gilles Moec, an economist at Deutsche Bank.
"A kind of bubble of uncertainty was created, around the regions, the banks, and it has consequences on the markets."
Passos Coelho has won a reputation for strict obedience to painful, German-driven recipes for cuts in social spending. He and top officials have met individually with big investors in Germany, China and the United States to sell their story.
Portuguese Finance Minister Vitor Gaspar, a former ECB research chief and European Commission policy wonk, has unchallenged authority over the economy and public finances, with full backing from Passos Coelho.
Spain’s shifting policies
By contrast, lines of responsibility for Spanish fiscal and economic policy have been blurred and sometimes crossed between Economy Minister Luis de Guindos, Treasury Minister Cristóbal Montoro and Rajoy's own economic advisors.
Rajoy pledged budget discipline but unilaterally loosened Madrid's deficit target, then had to negotiate with Berlin and Brussels for flexibility, while pleading in vain for the ECB to step in and buy Spanish bonds to calm markets.
"The government of Portugal has been better at communicating its strategy in a consistent and credible manner to investors," said a senior bond analyst who has visited both capitals.
"Senior officials there are articulate and persuasive and seem to be genuinely committed to implementing their reform programme," the analyst said.
Explaining the Portuguese government's resolve, political scientist António Costa Pinto of the University of Lisbon recalls that unlike Spain, Portugal did not enjoy an economic boom before the 2008 financial crisis struck.
"The government knows too well that the country stagnated for the last decade, so they really need to find a way out," he said. "Spain, for its part, still hopes to return to pre-crisis prosperity, so it tends to resist imposed austerity."
Catering to the home crowd
In contrast, Rajoy and his cabinet spent their first six months in office sending conflicting messages to the markets over their budget plans, the state takeover of troubled bank Bankia, the wider banking rescue, how regional budgets will be controlled and their access to markets.
"When he does issue statements, Rajoy is directing his message to the Spanish public, to voters, but the priority should be to recover the confidence of the markets. There's a tremendous cacophony," said a communication expert in Spain.
Senior officials in Brussels also say that the Spanish government has lost credibility and will be left with little room for manoeuvre in implementing its economic policy.
But Rajoy, who has shied away from the spotlight and left his ministers make tough announcements such as the European rescue for the country's banks, may now be changing strategy.
He stepped up to the firing line for the first time on 11 July, announcing a raft of new austerity measures in parliament in a dramatic speech.