Beckham & Kaka on score-sheet for Milan
The on-loan England midfielder finished off a neat move to complete the scoring and leave third-placed Milan six points behind leaders Inter Milan, who beat Sampdoria 1-0 at home in the late game.
Adriano hooked in Brazilian compatriot Maicon's dinked cross at the far post on halftime, minutes after Inter coach Jose Mourinho was sent from the dugout for arguing.
The champions, who lost 3-1 at Atalanta last weekend, laboured without suspended striker Zlatan Ibrahimovic and a weakened Samp side missing the injured Antonio Cassano almost snatched a draw at the end.
Juventus moved level with Inter at the top on Saturday after a fortunate 1-0 home win over Fiorentina and now lie three points adrift in second.
Milan went behind in Bologna on Sunday when Serie A top scorer Marco Di Vaio scored a ninth-minute penalty but Carlo Ancelotti's side soon drew level when Clarence Seedorf slid home after Kaka's effort was parried.
The Brazilian, who rejected a world-record move to Manchester City last week, then showed his class when he netted a spotkick and lashed in a superb left-foot shot shortly after Bologna's Gaby Mudingayi was dismissed.
Beckham, being urged by Milan fans to extend his two-month loan from Los Angeles Galaxy after a good start in Serie A, blasted in at the near post on 59 minutes.
AS Roma continued their charge up the table by beating Napoli 3-0 to inflict the home side's first league defeat of the campaign at the San Paolo.
Roma, last season's runners-up, had a terrible start to the season but now have surged up to join Napoli in fifth despite the fit-again Francesco Totti being left on the bench.
Philippe Mexes appeared offside when he headed the opener after Napoli's Marcelo Zalayeta had a goal ruled out for handball. Juan nodded in the second and Mirko Vucinic sealed the win with Napoli badly missing suspended midfielder Marek Hamsik.
Fourth-placed Genoa drew 1-1 at home to Catania to lie three points ahead of Roma and Napoli and four behind AC Milan.