Moved by pride:
Miriam and Aaron spake against Moses because of the Ethiopian woman whom he had married: for he had married an Ethiopian woman. And they said, Hath the LORD indeed spoken only by Moses? hath he not spoken also by us? And the LORD heard it.
-- Numbers 12:1-2 (KJV)
So, God summoned Moses, Miriam and Aaron:
And he said, Hear now my words: If there be a prophet among you, I the LORD will make myself known unto him in a vision, and will speak unto him in a dream. My servant Moses is not so, who is faithful in all mine house. With him will I speak mouth to mouth, even apparently, and not in dark speeches; and the similitude of the LORD shall he behold: wherefore then were ye not afraid to speak against my servant Moses?
-- Numbers 12:6-8 (KJV)
In His chastisement of Miriam and Aaron, besides esteeming Moses above them and setting him apart from all men, God declares the means by which He communicates with men - visions and dreams.
Now, a dream is the mechanism by which visions (words and/or pictures) are received by a prophet. Usually dreams occur during the night, but they can also take place during the day, as it happened to Balaam:
And Balaam lifted up his eyes, and he saw Israel abiding in his tents according to their tribes; and the spirit of God came upon him. And he took up his parable, and said, Balaam the son of Beor hath said, and the man whose eyes are open hath said: He hath said, which heard the words of God, which saw the vision of the Almighty, falling into a trance, but having his eyes open:
-- Numbers 24:3-4 (KJV)
And it shall come to pass afterward, that I will pour out my spirit upon all flesh; and your sons and your daughters shall prophesy, your old men shall dream dreams, your young men shall see visions: And also upon the servants and upon the handmaids in those days will I pour out my spirit.
-- Joel 2:28-29 (KJV)
Afterward -- that is, after:
the people have sanctified themselves, rending their hearts as well as their clothing (Joel 2:12-17); and
the cleansing fire (Joel 2:2-11) has thereby been averted (Joel 2:20); and
the land is restored (Joel 2:18-27)
there will no longer be any need for prophets in the land, because the spirit of God will have been poured out upon "all flesh". Sons and daughters, old men and young men, servants and handmaids, indeed, everyone, will know the heart and mind of the LORD (see also, Jeremiah 31:31-34)