How do I connect two 220V devices each with 12/2 wire to a 220V 12/3 feed?
Do you want the heater on the same switch as the pump? If so, then the simplest thing would be to add a new 12/2 wire between the switch and the heater. You'd run a short length of black wire (called a pigtail) from the switch to a new wire nut, where it would join with the black wire feeding the pump and the black wire feeding the heater.

It looks like the 12/3 wire was perhaps not necessary in this application. Typically, when 240V is carried over 3 wires, you have two hot wires on different phases (black and red), and one neutral wire (white). Voltage between either hot and the neutral is 120V and voltage between the two hots is 240V. If you have a device which only needs 240V, you can run this over a 2-conductor cable, and that is indeed what seems to be happening in your case. Note that some devices, such as clothes dryers, require 3 wires (plus ground) so that they can access both 240V (for heat) and 120V (for e.g. a lamp). Anyway, that may explain why your 12/3 suddenly changes to 12/2 - the neutral is simply unnecessary for 240V.

However, doing an electrical junction inside a ball of tape buried in the ground is a dangerous and horrible idea. It will be highly vulnerable to rain and yard work. Even with a GFCI circuit breaker, this wiring is unsafe for your family and visitors. You absolutely need to replace it with a proper junction, above ground in a dry and accessible location. And if you're only "pretty" sure there's a GFCI, I would strongly recommend getting an electrician to check this out. The buried ball of wire is a huge red flag that things were not done correctly and safely when this wiring was installed, and the danger here is serious.

I can't tell exactly what's going on in your picture. Is that a conduit line feeding the ball-of-wires or is it an outdoor electrical outlet fed off the same circuit? Buried wiring needs to be specially designated underground feeder (UF) type, is yours? These things should also be figured out while you have this all open.

My recommendation is to bury either conduit (easier to run new stuff later) or proper UF cable and completely rewire these devices. Your current configuration is seriously dangerous and needs to be corrected by someone who knows what he is doing. And given the carelessness evident here, you'd probably benefit from some further investigation inside the home. Sorry to sound so negative, but this is really too dangerous to be ignored.