The confusion when it comes to these two words is understandable. A lot of people write 'lay' when they should write 'lie' (as in lying down) and, however more rarely, vice versa. So here's a quick guide to how they are different and how they work.
'To lie' is an intransitive verb. That means that it's something you do, but not to something; it's an action without a direct object. You lie down. 'To lie' is conjugated: lie, lies, lying, lay, has/have lain. As you see, the past tense of 'lie' is 'lay', which is likely where the confusion begins. More on this later.
Examples:
He lies on the ground. (Present tense)
She is lying still. (Present participle)
They lay there together. (Past tense)
I have lain here for a long time. (Past participle)
'To lay' is a transitive verb. It's something you do to something; an action with a direct object. You lay something down. To lay is conjugated: lay, lays, laying, laid, has/have laid.
Examples:
She lays the pen on the table. (Present tense)
He is laying the bag on the ground. (Present participle)
I laid the book down. (Past tense)
You have laid the blanket on the armrest. (Past participle)
So, let's look closer at the usage of these words, in present tense.
First, intransitive 'lie':
I lie down. I (subject) lie (verb) down (adverb).
This clause has no object. That's how you can be sure that you should use the intransitive 'lie'; I'm not doing anything to anything else.
For comparison, another intransitive verb is 'to think'. It also functions without a direct object. I (subject) think (verb), no object required.
Now, transitive 'lay':
I lay you down. I (subject) lay (verb) you (object) down (adverb).
This clause has an object. I am laying you down, you in this case being the object (in the grammatical sense; I'm not objectifying you). Since I'm doing something to you, you know to use the transitive verb.
For comparison, another transitive verb is 'put' (which is sometimes interchangeable with 'lay'). It is a verb that requires an object. I (subject) put (verb) the knife (object) down (adverb).
'But!' you shout. 'What about "now I lay me down to sleep"??' Well, as strange as it may seem if you're not accustomed to grammatical terms, in that sentence you are both subject and object. That is to say, 'I' is the subject and 'me' is the object. So that sentence is perfectly correct. 'I lie down to sleep', but 'I lay me down to sleep'.
I hope this has been informative and edifying. A lot of writers (and people in general) seem to struggle with these particular words—I used to get it wrong all the time—but it's really very easy. You just have to know the difference. Happy writing!