Bam Performs Lil Wayne RAP

at Ryan Dunn Tribute

7/26/2011 2:15 PM PDT BY TMZ STAFF
Bam Margera rolled to Pennsylvania this weekend to help raise money for the widow of the passenger killed in Ryan Dunn's car crash last month ... by RAPPING to a Lil Wayne song!


Bam surprised everyone at The Note in West Chester, PA on Saturday ... when he hopped up on the stage, grabbed the mic ... and busted out the song "Runnin.'"

We're told everyone had a "great time" honoring Dunn and Zachary Hartwell ... and the event raised more than $20k -- all of which went to Zac's wife.