Muscle tone may play significant role in the different stiffness of your muscles versus your friend's:
In physiology, medicine, and anatomy, muscle tone (residual muscle tension or tonus) is the continuous and passive partial contraction of the muscles, or the muscle’s resistance to passive stretch during resting state.
That's pretty close to the "hardness" attribute you describe. How do you maximize it? Per Rippetoe and Kilgore's Practical Programming, page 42, sidebar:
tonus describes an electrophysiological phenomenon, a measure of ionic flow across muscle cell membranes. It can be thought of as the muscle's readiness to do anaerobic work. The more "fit" the muscle, the more electrophysiological activity it exhibits at rest. Lack of exercise leads to poor tone, aerobic exercise improves tone a little bit, low-intensity weight training improves tone more, and high-intensity training improves tone the fastest. As a test, go poke the traps or quads of an elite weightlifter at rest, if she'll let you. They'll be hard as a rock.
Emphasis mine. Note that the term "intensity" in this context means "how close one is lifting to one's 1-repetition maximum", not "how hard the workout was" or whether one went to failure. They would probably suggest weight training in the three to five rep range, as heavy as possible.
Other factors affecting "hardness" of your muscles could include, as others note, muscle density and how full the muscles are with blood or glycogen. Muscle density would be improved with strength training using compound exercises. Fullness of muscles probably isn't worth optimizing outside of bodybuilding competition, since it is transient.