The Buddha teaches deities when they visit the human plane where he normally resides,[5] and sometimes too by visiting them on the higher planes. On some occasions devas and brahmas come to the Buddha for clarification of Dhamma problems. On other occasions the Buddha becomes aware, through his supernormal knowledge, that a god needs some instruction to correct a wrong view or to goad him further on the path to awakening. Then the Buddha travels to the higher plane and gives the deity a personal discourse.
Once a brahman admirer of the Buddha recounted as best as he could evidence of the greatness of the Buddha. He was trying to convince other brahmans to meet the Buddha. His proof included the fact that "many thousands of deities have gone for refuge for life to the recluse Gotama" (MN 95.9). Devas, like humans, develop faith in the Buddha by practicing his teachings. In Chapter III we will see how grateful devas express this confidence. When devas come to visit the Buddha late at night, their luminous bodies light up the monastery as they pay respects to the Exalted One and ask their questions.
We will start with a god who was agitated by fear arisen from his sensual desire, and conclude with one who becomes a stream-enterer during his conversation with the Buddha.
Buddha is one of the avatArs of VishNu.
It is typical of the Devas to visit VishNu (NArAyaN) during His avatAr-kArya on earth. Some of them are also assigned tasks and roles to make His avatAr mission a success, and some are asked to take birth on earth to assist with the mission.
Bramha-Dev (the creator God BramhA, creator of BramhANDa - Universe) , Shiva, NArad-Muni and other Devas headed by King of Devas i.e. Indra, visited Shri KRshNa several times -- individually and in groups -- when He was on earth in Mathura, GokuL, Dwarka...
At His appearance in Mathura as son of Devaki and Vasudev, the devas sang hymns of praise. Shiva came down to GokuL to pay Baby KRshNa a visit, Indra learned a lesson from KRshNa at Goverdhan, Narad Muni was in constant touch and visited Him in Dwarka palaces, BramhA in Vrindavan and Dwarka, and finally when it was time for KRshNa to wind up His stay here, all devas headed by BramhA and Shiva came. They come to remind VishNu it is time to leave.
RAma was also gently urged to leave -- otherwise , He is unable to leave earth due to His overflowing compassion.