Rubber and bed mats
Cheap and removable, but they only cover the floor and slide around. Water and sand collect under them against bare metal, which causes the rust they were meant to prevent.
Spray-in liner
Bonds to the floor, walls and tailgate with no gaps. Nothing gets underneath. Textured, non-slip, and sealed against rust and water for the life of the truck.
The verdict
A mat is fine for light, occasional use. If you actually haul, or want to protect resale value, a spray-in liner is the only one that truly seals the bed.