Homer go to the Builder's Barn, and Homer meets Ray there. Ray apologizes to Homer for having not finished the job and promises he will stop by soon to work on the roof. Lisa, Marge, and Maggie arrive back at the retirement home, only to discover that Santa's Little Helper has become one of the old people. After Lisa succumbs to the same effect, they permanently take him back home. After waiting a long while for Ray to show on the roof, Marge becomes worried about Homer, and tells him that Ray is just a figment of his imagination. When Homer refuses to believe it, he falls off the roof and is knocked unconscious. The next day, Homer awakens inside Calmwood Mental Hospital, having been admitted there by Marge. Dr. Hibbert tells him that Ray does not exist; he was created by Homer's mind as Homer was feeling lonely and unappreciated because of the previous events he had endured. All the people that Homer thinks saw Ray - Bart, Ned, and the "Knockers" bartender - claim they did not, and Lisa reveals that "Ray Magini" is an anagram for "imaginary". When Homer spots Ray outside from the window of his hospital room, Hibbert assigns him to "electro-shock" (or electroconvulsive therapy). Six weeks later, Homer is now sure that Ray does not exist. As he is being discharged, he sees Ray again in the room. Angered by the pain the "figment of his imagination" has caused him, he assaults him. In retaliation, Ray knocks Homer out and everyone is surprised they can see him too. He did really exist the whole time: the bartender did not see Ray as he had an eye patch on (while looking in the direction of Homer and Ray that night, Ray was before his covered eye), and Ray could not be seen by Ned because he was behind the chimney. Bart still viewed Homer with skepticism for talking to thin air, but Stephen Hawking arrives and says that Bart could not see Ray at the hardware store because of a miniature black hole caused directly behind Ray which absorbed the light from Ray and made it look as though Homer was talking to himself when Homer was actually talking to Ray. Marge asks Ray why he started fixing the roof, and then just disappeared. Ray says he is a contractor. Everyone laughs, and Marge says