You'll have to describe it in better detail.
If it's like a hardend cord then it's likely a thrombosed vein which usually happens when there's some type of trauma to the penis and blood get's backed up in the vein. Most times it happens because of rough masturbation or sex. It normally goes away by itself. Could take a day, a week, or longer. But it's no big deal. Usually thrombosed veins aren't painful but can cause some discomfort.
If the lump feels like a pea and there is pain in the area and/or you notice a curve in the penis it's very possible that you have something called Peyronie's Disease (PD). It's caused also by trauma to the penis but the trauma actually causes scar tissue to build up, which is the pea size lump. The bend in the penis (sometimes slight, sometimes as sharp as 90 degrees) will be in the spot where the bump is. Though there are some treatments for this, there is no cure. After a year or two sometimes the scar tissue will be broken down and absorbed into the body and the pain and penis bend will go away. Even so, often times the person will lose some of their penis length. Yes, you read that correct. This is a rare disease and especially rare in guys under 40. So don't freak and think you automatically have this.
Only a urologist can tell you for sure.