All merging is bad, especially if either line is very busy. When trains start queueing they merge alternately. This sounds like a great idea, but because the trains are starting from stationary each time it's very slow. Your network will be better off giving priority to one line and allowing it to clear at full speed before the other line can merge. This is especially useful for joining a main line.
Using specialized signalling you can force trains joining your main line to wait for a gap. With a dual main line this works even better, as you can let trains on the inside move to the outside to let trains join. Other uses for this include Right-of-way Lane Change and Right-of-way Depot.
With two-way pre-signals and nothing extra you can force a merging train to stop if there's a train already on the main track directly in front of the combo or exit signal. The disadvantage to this construction is you can't extend the priority further than the length of two signals.
Priority Merges Using Extra Track
Longer priority can be designated by connecting track to activate the main merging signal upstream. When a train on the prioritized track drives onto a tile connected to the unused track it tells the signal on the merging track to read red. This construction can be made with both path signals and regular block signals on your tracks. The path signal construction needs only a single block signal on the merging track, while the block signal construction requires pre-signalling on the unused track to prevent trains from signalling themselves to stop.
Be careful to construct priority merges to accommodate your shortest train's length. If you have too much space in the middle, a train can briefly occupy a section of track without activating the merge signal, allowing a train to merge and disrupt traffic. This can be prevented by splitting longer priority into segments.
Right-of-way Merging onto Dual Main Line
All signals are combo signals except at points A and B which are entry signals, and the top right, which are exit signals. Adjust the length of the signal chain according to train length and speed.
Trains joining at point A must wait for the presignal chain along the inside lane to be clear. If a train arrives at point B before train A is out of the way then it will switch to the outer lane (at no speed penalty), but only if the presignal chain for the outside lane is clear. If it is not, the presignals at point B ensure that train B will take the line which clears first.
The connection of the presignal chains at point C is optional. It allows A to continue if the presignal chain for the outside lane is clear, even if the inside lane is not, as the train on the inside will probably be able move to the outside to let A out. When the lane-change is north of Signal B, A will always wait for the inside lane to clear, regardless of the state of the outside lane.