I wanted to make a joke, but was too late for the party.
Seriously speaking, it's not clear from the original message what exactly hurts: leg or even feet (AFAIK in several Slavic languages you may say "leg" for everything), a muscle or a joint, etc.
If it's leg (not feet) muscle, it may be because you hold your feet high raising them from pedals, or hold your legs, etc., and that causes muscle spasm. Try different postures, distance between the seat and the pedals. Also the seat should keep you in place and prevent sliding (in a bad seat, which is exactly horizontal, you gradually slide down).
If it's something else, then go to a doctor, they'll give a better advice, what exactly hurts and how to prevent it.