H.P.
While it probably is just teething or something innocuous like that, I would mention it to the doctor b/c it could be an ear infection (which would make her ears hurt when she is lying down). Also (and I'm sure this is not the case), BUT, it could be a heart problem or lung problem. When my son was 4 months old, he suddenly started screaming when we gave him his last bottle and would freak when we put him in his bed. He only stopped crying if we held him upright. Turns out he had an atrial flutter and was in heart failure... his lungs were filling with fluid so it made it hard to breathe when he was lying down, which is why he screamed when we put him in his crib.
Obviously, my situation was extreme and I don't want to freak you out, but just giving you an example of things that could be wrong. So, call your pediatrician just to make sure....