When you bought the bike...did you get fitted for it? Since you think it's too small a bike....I'll assume that's a no for now.
Riding the proper size frame, with the proper stem length, seat height (and forward/aft adjustments) and handbar width and height are CRITICAL factors in being able to ride with comfort and without pain for any significant distance on a bicycle. It sounds like your bike doesn't fit you properly. A bike shop that does fittings can help you with this.
On a proper fitting, comfortable bike...you should be able to ride 40, 50 even 100 miles or more without pain(assuming you are properly conditioned).
__________________
Just Do It..