Why is my throat in pain when I swallow a pill then lie down immediately?

Irritation. The pill may be stuck or sticking in the esophagus. Depending on the pill, it can be caustic and eroding the lining of the esophagus and can lead to a major and serious condition. Make sure to take pills with plenty of water and stay upright for 30-45 mins after (some meds even longer - ie fosamax) if persists or worsens - see your doctor.