You'll want the rag wet with fuel and attached around the neck of the bottle (tied, ziptied, or duct taped) before it's set alight. This will stop it from exploding in you or your friend's hand.
And for the love of god don't throw it overhead
Purely for educational purpose: how should a molotov be thrown ?
Why is a overhead thow a bad thing ?