Simple beam theory works fine. Treat the lateral load due to wind, seismic, waves, etc. as a distributed load and calculate the maximum span based on your maximum allowable stress or deflection for lateral loads. (This maximum allowable stress is often considerably smaller than the one in the Codes.)
Note that bowing due to thermal expansion also needs to be considered. The basic rule for horizontal deflection of pipe in a rack, for example, is that it should not hit anything or fall off the rack! Most companies have engineering standards for minimum clearances of pipe in racks; half of the required clearance should be your deflection limit.
Also see Kellogg, design of Piping Systems.
_________________________
CraigB