Here's what I did in my old Mazda when I was a poor college student and bike racer.
My plan works best if you have a bedliner, but may work ok without it. It cost me less than $10.
1. Cut a 2X4 so that it fits width-wise in the bed behind the back window.
2. Get some L-shaped aluminum. This is easy to find at hardware stores. About 2" X 2" angle is good - enough so you can drill a hole in the center of one leg and have enough room below the hole (you'll be mounting an axle in it) so your dropouts don't hit the bottom of the L. 1/8" to 3/16" thick is about right. Cut it in sections about 2-3 inches wide (a 2X4 is around 3-1/2", so anything close to that is fine, but the wider the more stable).
3. Find some old front axles with the cone nuts and locknuts (I don't know if those are the right names, but you need 2 nuts for each axle).
4. Drill a hole in the center of one leg of the L section so the axle will fit through but is a tight fit.
5. Put the cone nut on the axle, then put the L section on, then the locknut. Do this for both sides of the axle. Run a skewer through the axle.
6. Put the assembled piece on the 2X4 towards the side of the truck. It may help to put your bike on it to get the location right. Drill 4 holes in the bottom of the L bracket and into the 2X4. Put good long wood screws into those holes to attach the mount to the 2X4.
Typically you can fit 2 bikes side by side. With a big truck it might be possible to make 2 mounts and put one facing forward and one backward to fit 4 bikes.
If you have a bedliner you can remove, pull it out and flip it over and drill holes through it into the 2X4. I put these holes in the ribs of the bedliner so that the bolts that go into it were recessed and wouldn't scratch the paint.
That's about it. It worked great for many years. If you really want to make it secure for longer drives, run motorcycle tie downs from the left side of the bars on the bike to the left and the right side of the bars on the bike to the right down to the tie down loops in the bed of the truck. Then put one more tie down from one bike's bars to the other. Cinch all of them up and it will be very secure.
I had axles and skewers laying around and Al angle as well, so the only things I bought were screws and tie downs. You could probably get axles cheap from a bike shop since you don't need them to be nice.
Oh, to finish it all and protect it from the elements, paint the 2X4, angles, and axles with some decent spray paint.
EDIT - all that explanation and inillinois' pictures are pretty close to what I did except I made the mounts instead of buying them because I didn't have the dough at the time.