It sounds as if he is starting to treat you like a male (even if what he's saying is directly contradicting this). He is exerting dominance over you, and as a male, you need to put him in his place. If you grin and accept it, it will get worse, since you are not dominant. This might be very difficult for you, but this male hierarchy is a very real thing, and you can either allow yourself to sit at the 'bottom' of the pack, or work your way up by extruding confidence, dominance, and power.
Although he probably doesn't realize what he's doing, and as a former friend, you could probably talk to him about it and tell him it hurts, but that isn't a very masculine thing to do. Coming from 26 years of pretending to be a male, I know exactly now how to deal with people like that, and it's as simple as teasing him right back (if he says you don't have a penis // reply my clit puts your dick to shame) or being very confident with him in general, lots of laughing and smiling, punch him in the arm, pat him (hard) on the shoulder when you meet up, or on the upper back, never show hurt on your face or what bothers you, be vulgar...
These are things I learnt when I was in high school, male pecking order is the most intense in high school and then starts to mellow out as you get older, when everyone begins to 'find their place'. You can prove yourself in different ways as well, such as being great at sports, or other male centric activities. Beating bullies or alphas up gives great cred (I went from middle pack to top pack when I beat up a bully who was giving me ->-bleeped-<-, day in and day out). Not respecting authority in general does good for your cred as well (then again I was in high school about a decade ago, so things may change, but gender behaviour is probably the same).
I can keep listing off things that may help, but you may not be interested in dealing with it in this way, since it is very confrontational. You will have to learn how to deal with males from a male perspective eventually though (the same way I'll have to learn how to deal with women as a woman, I only really know how to deal with them as a 'man').