Rib and back pain

Beth • Due 12-13-15. Had a mc last year super nervous. Hoping this will be my miracle baby.
When I lay down at night, why do my upper ribs below my breast hurt and my back?