in the "classic way", the return address must be overwritten with an offset that has all the 4 octects different than 0 and which points to instructions that allow the code flow to point back to the memory address where is currently located your shellcode.
the cases in which you have no limitations on the bytes to use are enough rare and involve binary protocols (an example is
http://aluigi.org/adv/q3cbof-adv.txt), in these cases you can use also the zeroes without problems.
for example in the "classical" stack based buffer overflow you need to search a location where are located the bytes 0xff 0xe4 (JMP ESP) or 0xff 0xd4 (CALL ESP) which allow to continue the code flow on the address pointed by the ESP register which (in the classical example) is where is pointed your shellcode.
this means that if, at the moment of the exploiting (the return from the bugged function) your shellcode is located at [esp + 8] you must find a location in memory where there is a "pop xxx, pop xxx, ret" (correct?) or other instructions which can allow to redirect the code flow on the shellcode.
usually these locations must be searched in the modules (the dll) of the software (for example binkw32.dll) or in system modules (kernel32.dll, advapi.dll and so on).
anyway this is only a generic explanation of the basis with some generic examples, I have never lost time with exploits because I'm not interested in them so my knowledge in this field is limited.
I guess that someone else here can explain the whole thing better.