(33) CHAPTER. Whoever comes when the Imam is delivering the Khutba (religious talk) should offer a light two Raka Salat (prayer) (Tahayyat-ul-Masjid).
Narrated Jabir: A man entered the Mosque while the Prophet was delivering the Khutba. The Prophet said to him, Have you prayed? The man replied in the negative. The Prophet said, Pray two rak`at.
Authentic