Hand pain?
Do you have dropped handlebars or straight? If you have straight ones do you have bar-ends?

I agree with Dianyla about the rest of the bike too. If you saddle is too tilted (you know how we do sometimes to offload our "bits", it can shift your weight too far forwards. Also if you are over-reached, the same result.

Firstly you need to concentrate on keeping your weight off your arms either by 1, bike adjustments or 2, trunk or core strength.

Secondly you need to make your hands as comfy as possible for the weight that you cannot avoid putting through them; with bar tape and good gloves.

Core stability is probably the one thing that we all neglect and any bike trainer will get you doing exercises as soon as look at you! Core strength is used in climbing, riding hard and fast and for general posture on longer rides. So we all need it really to avoid niggles in necks, shoulders and hands.

Planks are the safest and surest way to build up core strength without risking back injury: elbows and forearms and toes are on the floor, while your body makes like a plank. Build up the time you can hold it for. You will be amazed how hard it gets and how quickly! If you wear a pulse meter reader at the same time, you just watch your heart-rate rise!
Side planks are simelar; feet together, elbow and forearm at shoulder level and lift your body up in-line. You can lay your non-loaded arm along your side. Then change sides and repeat.

I started doing 20 seconds at each combined with some proper back-protecting sit-ups and I can now do over a minute. It has stopped all my hand pain, improved my climbing position and I generally feel less worn out after a long ride.

Planks...that's the answer.
Good luck!