When we are trying to communicate with the Lord, how do we know for sure it is the Lord we are communicating with, and not the tempter?
Very good question. The more you study into the bible (God's Word). The more you will learn about God, God's character is perfectly revealed through Jesus.
Pray, Study the Word, Tell others about Jesus.
You will recognize His voice the more you talk to Him (praying). If God is trying to tell you something He will make it very clear.
Also the bible says to know your enemy. So know who your enemy is; The flesh, the World, Satan/demons...
You will realize that Satan always speaks lies so take captive of all your thoughts. If you are hearing something that doesn't line up with God's word do not believe it.