Imam Khomeini, citing Quranic verses explains the way and methods the messengers receive revelation from God the Almighty.
According to Imam, It is angel Gabrial who brings revelation to divine messengers.
The messengers can also directly receive revelation from God the Almighty. It depends on spiritual capacity of the messenger who received the revelation.