Sayyiduna Abu Hurairah (may Allah be pleased with him) reports that the Messenger of Allah (peace and blessings be upon him) said: "The best deed in the sight of Allah is faith, there is no doubt in it."
Regarding the matter of "the best of deeds" (afdal al-a‘mal), in various hadiths, different deeds have been mentioned as the best of deeds for different individuals at different times. Sometimes prayer (salah) is mentioned, sometimes jihad, and sometimes other matters are mentioned as the best of deeds. This is according to the status of the questioner; the Messenger sallallahu alayhi wa sallam mentioned whichever deed was most needed by the person asking.