brake pedal getting hard

ok so lately i have been gettin in to drive to work in the morning and the brake pedal would be hard as a brick, as if someone was pumping the brakes.
now when i start up the car it will go back to nomal and its fine when its running. if i stop somewhere like at a gas station, or somewhere were im in and out the pedal wont be hard. its only when its been sitting for awhile.
now when i start up the car it will go back to nomal and its fine when its running. if i stop somewhere like at a gas station, or somewhere were im in and out the pedal wont be hard. its only when its been sitting for awhile.