The answer is not just a guess. I have ‘heard’ a message in prayer over two dozen times. When it first happened, my first impression was to dismiss it as a thought of my own, because it bears similarities to thoughts. Over time, and with much prayer, Bible study and silent contemplation, I am much more able to discern when these mental messages are from the Holy Spirit. (Yea, you think that's nuts.) In addition, I have for years been collecting stories told by other people who also said they ‘heard’ a message in prayer, and believed it was offered by God (in one of his three forms, including Jesus or the Holy Spirit). When one compares these messages to look for commonalities, one finds common characteristics that can help us discern whether the message might be from God.
1. The voice is heard inside one's self, but not commonly through the ears. But a voice nonetheless.
2. The voice is loving, credible and authoritative. He sounds loving even when providing needed correction.
3. He identifies himself as being a different person than you, and you can tell the voice belongs to a being different than yourself. Sometimes it surprises, because you wouldn’t have such thoughts.
4. His message is in response to what your current need is. Not necessary your current want. Your need. This is another indication you are not generating the words on your own.
5. The message is brief, but full of meaning. It often has at least two layers of meaning, like a good poem, or Bible verse. As such, it is usually not a complete explanation, but just enough to make you contemplate it over and over.
6. The message corresponds to Biblical teaching.
7. The impact on the listener was to both support the listener and to bring them closer to God.
8. If the message is heeded, the listener encounters spiritual growth.
One misconception about God’s involvement on Earth is that He only speaks about world-changing events and prophesies affecting millions of people. Rather, modern reports almost always describe His messages to individual believers as having one of the following purposes: to strengthen the faith of that one believer, to protect the listener from error or harm, or to encourage the listener to assist another person. It’s very small-scale and personal. Intimate, you might say. As from a great personal friend who loves you. To read true stories about real people who have heard the sound of God's voice, go to the Wtness.org site’s category titled “Sound of God’s Voice”.