I loaned my rv out to a friend and it came back with the generator not starting . it just clicks and electrical smoke is coming from the generator. what could happen. they say it worked fine during there trip. any suggestion?

Sounds like something shorted inside. Is the smoke from an external component, maybe the fuel pump or starter motor, or from inside, e.g. the stator or armature that actually do the electrical power generation? The later is a VERY expensive repair.

Since it just clicks when trying to start it, my first guess would be that the starter motor has failed.

My 1992 Onan 4000 did the same after I abused the starter during adjustments. I removed the entire unit an found the plastic starter gear had wedged itself against the flywheel. Amazon had a new starter ready to install for $34. Piece of cake

I had the same experience as B737doc. A few weeks ago, my house batteries were low and when I tried to start the generator, it began to smoke and smelled like burnt wires. I had to remove the generator and I found that the Bendix gear on the starter had jammed against the flywheel, and the smoke was probably caused when I gave it several attempts to crank it and the starter was trying to turn in place. I removed the starter and did a bench, which revealed it still worked. Neither the generator nor the starter had any burned wires. I placed the starter back and put the generator back. The generator is now running great again.