In his first appearance of any kind since Real Madrid's victory in the UEFA Champions League final, Ronaldo threatened regularly in his 74 minutes but was forced to take a back seat to the eye-catching Guedes.
The Paris Saint-Germain winger, who is reportedly attracting interest from Premier League club Wolves, netted either side of half-time to give Portugal a timely confidence boost eight days out from its opening Group B clash against Spain.
Guedes's brace sandwiched a first international goal for Bruno Fernandes, the 23 year-old heading in a superb Ronaldo cross amid driving rain in the 37th minute.
That, though, was to prove the Madrid man's greatest contribution in his milestone match, with opposition goalkeeper Abdelkader Salhi offering able resistance to the 33 year-old.
While Algeria otherwise offered little in the way of the challenges the European champions can expect to face in Russia, Fernando Santos will be no less relieved to have ended a three-match winless run at just the right time.
Portugal's early command of possession illustrated the gulf in class and the inevitable opener arrived in the 17th minute.
Bernardo Silva cleverly nodded William Carvalho's lofted pass into the path of the fast-arriving Guedes, who made no mistake with a simple low finish.
Ronaldo looked likely to double the advantage in quick time when Fernandes released him into the area, but Salhi was quick off his line to divert the left-footed finish.
Instead, he turned provider for Fernandes eight minutes before the break, curling a delightful cross in from the left that invited the Sporting midfielder to head home.
Ronaldo remained on the pitch after the interval and could have scored from either of two promising opportunities, only to be denied by the confident Salhi on both occasions.
The mounting chances eventually resulted in a third in the 55th minute as left-back Raphael Guerreiro's measured cross was met by a thumping Guedes header.
Frustration would only grow for Ronaldo when he misjudged an acrobatic volley attempt on the hour and that was to prove his final chance at getting on the scoresheet, with Andre Silva introduced in his place with 16 minutes remaining.
Any hint of a rout disappeared with his withdrawal as Portugal appeared content to begin fixing their focus on the all-important clash with Spain on June 15 that will go a long way to shaping Group B.
The hosts did have the ball in the net one final time through Joao Mario, only for the VAR to chalk off the goal due to a handball in the lead-up from Guedes.