If they are really friends they don't.
People develop irritability towards their peers or friends, most likely because they wish they knew how to do the thing that they are showing off. They often think about it and wish that they got that much positive feedback and attention. Some people then go further and try to do the same thing their friend did and fail, and then get even more upset in their downfall.
Maybe he is worse than him or bad feeling, makes he feel jealous, but for me sincerely, i tell him a congratulation and hope he is proud of himself