The Navy secretary resigned yesterday, with Undersecretary Hung Cao, a Navy combat veteran and Senate candidate, stepping in as acting secretary amid Pentagon shifts.