There's a few possible causes that I'm aware of,
If you haven't already you can book an appointment at the genius bar at your nearest apple store (they aren't the greatest of help with older models depending who you get serving you)
The part called the dock connector at the bottom of the phone which houses the speaker, microphone, connection for the lead and one of the antennas could be faulty, these are available on ebay for around £5.
There's a tiny brass pin inside (there's a couple in total) down at the very bottom right hand side of the logic board that grounds to the chrome bezel, check this is touching the bezel, some people have rumoured this pin to be the cause of some signal problems.
If the phone has ever been taken apart in the past there's a tiny component on the logic board that can be knocked off, see this link for what to look for and the fix if it is missing
http://www.mauron.net/iphonerepair/
http://matteopisani.altervista.org/iPhone3GS_NoService_Losing_Signal_Fix_Repair_Guide.htm
Also if the phone has been stripped down at any point (to replace a battery etc) and the screw under the 'do not remove' sticker hasn't been removed and the logic board pulled to try and remove it the little tail at the bottom can crack on the underside and needs to be soldered back together (i've seen this a couple of times).
The problem can be software related (apple never admit to this) and if the phone is not jailbroken a restore and update in itunes can fix the problem (be sure to back everything up first, itunes doesn't back up your photos) and see if that works.
As a last resort I've heard of jailbreaking them curing the no signal fault.
Some of these apply to the 3g and 3gs, hope one of these sorts it.
Failing the above it's a case of trawling the internet and forums as I'm sure there'll be causes I haven't heard of.