The Ramadaan fast, and indeed any righteous deed, is not
accepted if you do not pray. That is because not praying
constitutes kufr as the Prophet (peace and blessings of Allaah
be upon him) said: “Between a man and shirk and kufr there
stands his giving up prayer.” Narrated by Muslim, 82.
No righteous deed is accepted from the kaafir, because
Allaah says (interpretation of the meaning):
“And We shall turn to whatever deeds they (disbelievers,
polytheists, sinners) did, and We shall make such deeds as
scattered floating particles of dust”
[al-Furqaan 25:23]
“If you join others in worship with Allaah, (then)
surely, (all) your deeds will be in vain, and you will
certainly be among the losers”
[al-Zumar 39:65]
al-Bukhaari narrated that the Prophet (peace and blessings
of Allaah be upon him) said: “Whoever forsakes ‘Asr prayer, his
deeds are in vain.” (al-Bukhaari, 553). What is meant by “his
deeds are in vain” means that they become invalid and will not
avail him anything.
This hadeeth indicates that in the case of one who does not
pray, Allaah will not accept any deed from him, so the one who
does not pray will not benefit at all from his deeds, and no
good deeds of his will ascend to Allaah.
Ibn al-Qayyim (may Allaah have mercy on him) said concerning
the meaning of this hadeeth: “The apparent meaning of this
hadeeth is that those who do not pray are of two types: those
who do not pray at all, which renders all of their deeds
invalid, and those who do not pray some days, which renders his
deeds on that day invalid. So the loss of all good deeds
happens to those who do not pray at all, and the loss of some
deeds happens to those who miss some prayers.” From Kitaab
al-Salaah, p. 65
“And (remember) the Day when the Zaalim
(wrongdoer, oppressor, polytheist) will bite at his hands, he
will say: ‘Oh! Would that I had taken a path with the Messenger
(Muhammad).
Ah! Woe to me! Would that I had never taken so-and-so as
a Khaleel (an intimate friend)!
He indeed led me astray from the Reminder (this Qur’aan)
after it had come to me. And Shaytaan (Satan) is to man ever a
deserter in the hour of need’”
[al-Furqaan 25:27-29 – interpretation of the meaning].