A lot of factors could be contributing to your pain. From what you wrote, if you only get pain when cycling then its most likely due to tissue over load. Basically some structure(s) in your foot are being subjected to more load than it can cope with and becomes painful. Now the hard bit, You simple have to find a way of distributing the load differently to lessen the force going through the structure that becomes painful.
Couple of places to start looking out is position of foot on the peddle (weather you use clips or flats). Try different shoe, a lot of cycle shoes are quite narrow which can course problems in the foot (even if it means putting different pedals on to try different shoes).
Have a look at weather you over pronate as this can lead to problems, you can buy sets from specialized that can help with this.
Do some research on the above areas to get a basic understanding, quite a lot of info online. Hopefully by having a play around with set up you should be able to solve the problem.