Any railroad company heretofore incorporated or hereafter organized, in pursuance of law, may aid any other company at any time, by means of subscription to the capital stock of the other railroad company, or otherwise, in the construction of its railroad within or without the state for the purpose of forming a connection to the other road with the road owned by the company furnishing the aid.