Have you been sick lately? Because you could have a pneumonia in your right lung. I know that when I have pneumonia that's the only time I can feel any pain with it. An xray can show what's going on, if not your doc might order a CT scan.At any rate, don't wait,
go get your answers as soon as you can as waiting can be dangerous. Take care.
I'm assuming you are a smoker? If so, you might want to go to a pulmonary doctor and get x-rayed.
If you do smoke, you might want to consider quitting now. Most of us had some symptom that brought us here. We probably would have continued smoking had it not been for a pain, twinge, or something that made us realize that we were in trouble.
You have to be in charge of your body and take back control over it. Put the smokes down and never look back.
You asked why you had pain only when you are laying down.......throughout the day most of us keep ourselves busy enough that we don't really pay attention but at night, when you are supposed to be sleeping, that's when you are going to feel it most. I have the same issue with my legs (restless leg syndrome), but only when I am relaxing.
Good luck!