How can I treat a painful lump on shin (tibia), due to direct impact?

Time. It is probably a bone contusion with a hematoma. You can initially try ice within 48 hours to reduce swelling. After about 5 days, you can switch to moist heat to try to increase blood flow to area to resorb hematoma quicker. If it hurts to bear weight, be seen to make sure it is not broken. If it gets red and hot, be seen as it can get infection in it.
ICE. Ice, compression, and elevation are the basic first aid maneuvers for such an injury, when acute. However, if this is a persistent lump some time after the injury, you should seek a medical evaluation. Good luck.