That's not feminine; that's masculine. These are "pausal forms", so when the preposition lamed plus 2 msc sg suffix would normally be lĕkā, in "pause" it is lāk -- which is the same form as the 2 fem sg, and thus the confusion.
See Gesenius-Kautzsch-Cowley, Gesenius' Hebrew Grammar (2nd edn; Clarendon Press, 1910), at § 29n, p. 97 (last line of that paragraph).
Most grammars will give you a section on pausal forms (check index). There's a nice article by E.J. Revell, "Pausal Forms in Biblical Hebrew: Their Function, Origin and Significance", Journal of Semitic Studies 25 (1980): 165-179 [first article listed in ToC] if you're interested to dig deeper...
...or, even deeper, Richard Goerwitz's 1993 University of Chicago PhD dissertation, "Tiberian Hebrew Pausal Forms". See also the Jewish Encyclopedia article on "Accents in Hebrew" for the interaction of the accentual system with pausal forms (or, with encoding problems at that site, see the original page scans).