The first one is correct. The second sentence is grammatically correct whereas in #2, there are some words missing to make the phrase complete. For example, you could say "...Ahmed passed me and lent (or gave) me some money." I would remove "beside" as it's redundant (don't need it when "passed" suffices for where the friend is in relation to you) and put "and lent" (or "and gave") to make clearer what happened when you happened to meet your friend. I hope this helps. :-)