Receptors for temperature and pain look like the axon terminals without any other structure around them. They are typically called free nerve endings. Free nerve endings for temperature have ion channels that respond to particular temperatures, while other free nerve endings generate action potentials in response to extreme force on the skin or other potentially damaging stimuli that is felt as pain. Some receptors — those having what are called transient receptor potential (TRP) channels — respond to both.
Different temperature receptors respond best to particular temperatures. Warmth receptors respond best to particular temperatures above body temperature (98.6 degrees Fahrenheit), while cold receptors respond best to particular temperatures below body temperature. You judge a wide range of temperatures (cool, damp, chilly, cold, warm, humid, hot, and so on) by sensing the unique ratio of activation of the different receptors activated at any particular temperature.
Extreme heat, cold or skin pressure, however, activates receptors that are interpreted as pain. Although different types of pain receptors work by different mechanisms, what they have in common is that the sense of pain signals impending damage to the skin. Pain receptors also exist that respond to chemical damage from acids or bases, and other types of damage such as that caused by a cut.
Pain and temperature sensations tend to be carried by small caliber axons in a spinal cord tract called the lateral spinothalamic tract. A more medial pathway called the lemnical tract carries fine touch information via larger caliber axons with faster conduction velocities.