Beacon Roofing Supply Inc. has officially rejected a hostile takeover approach from QXO Inc., setting the stage for a potentially protracted battle for control of the building supplies provider.