WASHINGTON — Both houses of Congress are moving to guarantee greater access to contraceptives for women in the military, actions that lawmakers say are prompted in part by concern about unplanned pregnancies in the armed forces.

The annual defense policy bill, passed on Friday by the House, says military clinics and hospitals must be able to dispense any method of contraception approved by the Food and Drug Administration. Women have complained that they are sometimes unable to obtain contraceptives prescribed by their doctors, especially when they are deployed overseas.

The House bill also says women should, whenever possible, have access to “a sufficient supply” that will last for their entire deployment. Women who are overseas for long periods sometimes report that they have difficulty refilling prescriptions because military clinics run out of specific contraceptives and resupply shipments can be slow to arrive.

Representative Jackie Speier, Democrat of California, said she had pushed for the changes because recent studies had shown that women in the military had a higher rate of unplanned pregnancy than the general population.