Birds do it, and bees do it - and although we don't know how, how often, or for how long, dinosaurs had sex, too. The reason dinosaur mating is such an enduring mystery is that it's hard to picture a seven-ton Tyrannosaurus Rex male putting the moves on an even bigger female, or a pair of Triceratops managing not to impale themselves on each others' horns as they attempt to perpetuate the species. Add the fact that soft-tissued male and female genitals don't tend to persist in the fossil record, and the average paleontologist knows less about dinosaur sex than a second-grader knows about the human variety.
To show just how huge a mystery dinosaur sex is, it's only in the past few years that scientists have been able to reliably distinguish between male and female dinosaurs of the same species - and even these interpretations aren't universally accepted by the scientific community. Logically, there's every reason to believe that female dinosaurs possessed bigger hips than males, since females, by definition, had to carry and lay eggs, sometimes very big ones. Also, there's good evidence that, say, the frills of male ceratopsians were bigger than those of females - large frills being a sexually selected characteristic that helped males to attract mates.
Dinosaur Sex - Reasoning by Analogy with Modern Mammals
Since there aren't any living specimens available for observation, one way to explore the sex life of dinosaurs is to extrapolate backward from the largest land animals alive today - elephants and giraffes. With their long necks and squat trunks, giraffes are shaped a bit like sauropods (check out a side-by-side picture of a giraffe and a Brachiosaurus); the way they have sex is that the male approaches the female from behind, keeps his neck low to the ground (so as not to put undue stress on his heart), and does his business very quickly. Elephant males - which vaguely resemble mid-sized hadrosaurs - also approach females from the rear, and they don't linger too long during the act, either.
The trouble is, reasoning by analogy can only take us so far. As big as it may seem to us, a one-ton male giraffe is tiny compared to a 25-ton Brachiosaurus; it's hard to imagine a healthy female sauropod successfully bearing the sheer back-breaking weight of a male even for five or 10 seconds. And a big reason that full-grown elephants can mate at all is that their tails are laughably tiny; imagine the logistics that would be involved with the long, heavy, bulky tails of a Parasaurolophus male and female. Whatever the genitalia of male and female dinosaurs looked like, they were certainly tucked somewhere under these huge appendages, making dinosaur tails a bit like the Jurassic equivalent of chastity belts.
Dinosaur Sex - Reasoning by Analogy with Modern Reptiles
Ideally, we could infer all we need to know about dinosaur sex by observing bird sex - after all, birds are the direct descendants of dinosaurs, and at least some species have presumably retained the sexual habits of their ancestors. But once again, there's a big "uh-oh" here: the biggest birds are orders of magnitude smaller than the biggest dinosaurs (for more on this vexed topic, see Why Aren't Birds Dinosaur-Sized?), so guessing how stegosaurs had sex by observing the mating habits of chickens doesn't make much sense (though one can presumably make a better case for the roughly chicken-sized Velociraptor).
In this case, we're closer to the mark considering the mating habits of another close dinosaur cousin: crocodiles, which branched off from the precursors of dinosaurs, the archosaurs, at the end of the Permian period. Large crocodiles and alligators mate in the water; the male hovers over the female for a few seconds and deposits his sperm into her cloaca. The advantage here is that the natural buoyancy of water reduces the effective weight of the male, so it's tempting to imagine a male and female Apatosaurus venturing briefly into a nearby lake to accomplish the deed. Sadly, though, we have absolutely no fossil evidence that dinosaurs mated in the water. (Although no large dinosaurs have ever been preserved in the act of mating, the same doesn't apply to smaller prehistoric reptiles; for example, paleontologists have unearthed no less than nine copulating pairs of the Eocene turtle Allaeochelys.)
Did Dinosaurs Even Have Sex Organs?
As mentioned above, sex organs - since they're made of easily biodegradable "soft" tissues - are virtually never preserved in the fossil record; that's the same reason we have no direct evidence of dinosaur lungs, kidneys, or intestines. Paleontologists can't even say for sure if male dinosaurs were equipped with penises, or if female dinosaurs had something even remotely approximating the modern mammalian vagina. (You can stop laughing now: from a biological standpoint, there's no reason a hundred-foot long Argentinosaurus would need a penis the size of a Lincoln Town Car, though you have to admit it is an arresting image).
Judging by the anatomy of modern reptiles, though, it's more likely that male and female dinosaurs possessed cloacas rather than specialized sex organs - that is, primitive orifices used for urination, defecation, and copulation (hopefully not all at the same time). Once a male and female dinosaur arranged themselves into the right position, sex by cloaca would have been a simple affair; all that would have been needed was a few seconds for the male to deposit his sperm in reasonably close proximity to the female's eggs. Talk about anticlimactic: it's possible that sex between an Allosaurus male and female lasted only as long as a good sneeze!