It is part of the Sunnah that a Muslim should say at the beginning of his food and drink "Bismillah" in order to be protected and his food and drink are blessed. Al Bukhari and Muslim reported in their books of authentic Hadiths on the authority of `Umar ibn Abu Salamah (may Allah be pleased with him) who said: "I was a boy under the care of Allah's Messenger (peace be upon him) and my hand used to go around the dish while I was eating. So, Allah's Messenger (peace be upon him) said to me, O boy! Mention the Name of Allah and eat with your right hand, and eat of the dish which is nearer to you. Since then I have applied those instructions when eating." [Sahih Al Bukhari No. 5376 and Sahih Muslim No. 2522].
Mentioning the name of Allah before eating has many benefits, of which: The food shall be blessed. It was reported in Sunan Abu Dawud, Ibn Majah, and others on the authority of Wahshy ibn Harb from his father from his grandfather (may Allah be pleased with him) that "Some of the Companions of the Messenger of Allah (peace be upon him) said: O Messenger of Allah, we eat but we do not feel full. He (peace be upon him) said: Perhaps you eat separately. The Companions replied in affirmative. He then said: Eat together and mention the Name of Allah over your food. It will be blessed for you." [Sunan Abu Dawud No. 3764, and Sunan Ibn Majah No. 3286].
Of the benefits of mentioning the name of Allah before eating is expelling Satan and keeping him away, so he cannot be able to share food or drink with people. It was reported in Sahih Muslim on the authority of Hudhayfah (may Allah be pleased with him) who said: "When we attended a meal with the Messenger of Allah (peace be upon him), we would not stretch forth our hands towards the food until he (peace be upon him) would start eating first. Once, we were with him when a little girl rushed in as if someone was impelling her. She was about to lay her hand on the food when the Messenger of Allah (peace be upon him) caught her hand. Then a bedouin came in rushing as if someone were pushing him. He (peace be upon him) caught his hand also and said: Satan considers that food lawful for himself on which the Name of Allah is not mentioned. He (Satan) brought this girl to make the food lawful through her but I caught her hand. Then he brought the bedouin to make it lawful through him but I caught his hand too. By Him in Whose Hand my soul is, now Satan's hand is in my grasp along with their hands. Then he mentioned the Name of Allah and began to eat." [Sahih Muslim No. 2017].
It was reported in another Hadith that Satan says when a Muslim forgets to mention the name of Allah before entering his home and before eating: "You have found a place to spend the night and evening meal." This is a proof that mentioning the name of Allah expels Satan and keeps him away from entering the house or sharing food and drink. It is enough for a Muslim to say in such condition: "Bismillah." As for the addition of "Ar-Rahman Ar-Rahim," it was not authentically reported from the Prophet (peace be upon him).
When a Muslim forgets to mention the name of Allah before eating, he may say during his eating: "Bismillahi Awwaluhu wa Akhirahu." Abu Dawud, Ibn Majah, and others reported on the authority of `A'ishah (may Allah be pleased with her) that the Messenger of Allah (peace be upon him) said: "When any of you wants to eat, he should mention the Name of Allah in the beginning, (i.e., say Bismillah). If he forgets to do it in the beginning, he should say Bismillah awwaluhu wa akhirahu (I begin with the Name of Allah at the beginning and at the end)." [Sunan Abu Dawud No. 3767 and Sunan Ibn Majah No. 3264, and Al Albany (may Allah bestow mercy on his soul) graded it as authentic in Sahih Al Jami` No. 380].
The previous Hadith proves that mentioning Allah should be done before eating, but if a Muslim forgets it, he may say the phrase mentioned in the Hadith.
It was reported in another Hadith which its chain of transmission is weak that Satan vomits what he eats when a Muslim mentions the name of Allah. Abu Dawud and An-Nasa'y reported on the authority of Umayyah ibn Makhshy (may Allah be pleased with him) who said: "I was sitting and a man was eating. He did not mention Allah's name until there remained the last morsel. When he raised it to his mouth, he said: In the name of Allah at the beginning and at the end of it. The Prophet (peace be upon him) laughed and said: The devil kept eating along with him, but when he mentioned Allah's Name, he vomited what was in his belly." [Sunan Abu Dawud No. 3768, and see: Irwa' Al Ghalil 7/ 26; however the Hadith is weak according to Al Hafizh ibn Hajar and others].
As for mentioning the name of Allah during eating for those who forgot to mention the name of Allah, it was authentically reported as was mentioned in the previous Hadith.
A Muslim should thank Allah (may He be Glorified and Exalted) after eating and drinking, for Allah is pleased with His Servant when he does so.