Section 51. A town which has acquired a plant for the manufacture or distribution of gas may purchase gas from another town authorized to sell the same or from any corporation selling gas; and a town which has acquired a plant for the manufacture or distribution of electricity may purchase electricity from another town authorized to sell the same or from any corporation selling electricity and may contract for the purchase, sale or maintenance of equipment, supplies or materials used in the ordinary course of business with any other town or towns having acquired such a plant or with any corporation selling electricity, except as provided in section fifty-two.