You probably have shin splints, which is irritated and swollen muscles, often from overuse. Shin splits are common, so don't be scared.
Rest your body. It needs time to heal.
Ice your shin to ease pain and swelling. Do it for 20-30 minutes every 3 to 4 hours for 2 to 3 days, or until the pain is gone.
Anti-inflammatory painkillers. Nonsteroidal anti-inflammatory drugs (NSAIDs), like ibuprofen, naproxen, or aspirin, will help with pain and swelling. These drugs can have side effects, though, like a greater chance of bleeding and ulcers. They should be used only occasionally unless your doctor says otherwise.
Arch supports for your shoes. These orthotics -- which can be custom-made or bought off the shelf -- may help with flat feet.
Range-of-motion exercises, if your doctor recommends them.
Neoprene sleeve to support and warm your leg.
Physical therapy to strengthen the muscles in your shins.
Nope