The resistivity as function of temperature of high temperature superconductors is very unusual and despite its importance lacks an unified theoretical explanation. It is linear with the temperature for overdoped compounds but it falls more quickly as the doping level decreases, and for weakly doped samples it has a minimum, increases like an insulator before it drops to zero at low temperatures. We show that this overall behavior can be explained by calculations using an electronic phase segregation into two main component phases with low and high densities. The total resistivity is calculated by the various contributions through several random picking processes of the local resistivities and using the Random Resistor Network approach.