Ask a room of professional editors to name the hardest pair in ordinary English and most of them will say this one. Not the rule — the rule is manageable. The past tense. Because the past tense of "lie" is "lay". The same word as the present tense of the other verb. So somebody who has learned the rule correctly, and applies it correctly, writes "she lay down" and then stares at it wondering whether they have just made the mistake they were avoiding. They have not. But the correct answer looks exactly like the error, which is why this pair defeats people who have no trouble with any of the others.
A transitive verb — it needs an object. To put something down. Past tense: laid.
An intransitive verb — no object. To recline, or to be situated. Past tense: lay. Past participle: lain.
Lay and lie are two different verbs, and the difficulty is that their forms overlap. Lie means to recline or rest, and it takes no object: I lie down, the book lies on the table. Lay means to put something down, and it always needs an object: lay the book on the table, the hen lays eggs.
The overlap is in the past tense. The past of lie is lay: yesterday I lay on the couch. The past of lay is laid: yesterday I laid the book on the table. So "lay" can be the present of one verb or the past of the other, which is why it is so often used wrongly.
The full forms: lie, lay, lain, and lay, laid, laid. A third verb, lie meaning to say something untrue, is regular: lie, lied, lied.
I'm going to lay down for an hour.
✓I'm going to lie down for an hour.
You are reclining, with no object being put anywhere: lie.
Yesterday I laid on the beach all afternoon.
✓Yesterday I lay on the beach all afternoon.
The past tense of lie (recline) is lay. Laid is the past of lay (put).
Please lie the files on my desk.
✓Please lay the files on my desk.
You are putting something down, so the verb with an object: lay.
Quick way to remember
Ask whether there is a direct object — something being put down. If yes, use "lay": you lay a book on a table. If nothing is being placed, use "lie": you lie on a sofa. For the past tense, remember that yesterday you lay down, but you laid the book down.
Is it "lie low" or "lay low"?
Lie low is the standard form, meaning to stay out of sight. Lay low is common in speech but is traditionally a mistake.
Why does the prayer say "Now I lay me down to sleep"?
Because it has an object, me. Laying yourself down is the verb lay, so the prayer is correct.