Step 1: Find the midpoint of the line segment \( AB \).
The midpoint \( P \) of the segment joining \( A(2, 3, 4) \) and \( B(4, 5, 8) \) is given by:
\[
P = \left(\frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2}, \frac{z_1 + z_2}{2}\right).
\]
Substitute the coordinates of \( A \) and \( B \):
\[
P = \left(\frac{2 + 4}{2}, \frac{3 + 5}{2}, \frac{4 + 8}{2}\right) = (3, 4, 6).
\]
Step 2: Find direction ratios of the given lines.
The direction ratios (DRs) of the first line:
\[
\frac{x - 8}{3} = \frac{y + 19}{-16} = \frac{z - 10}{7} \quad \Rightarrow \quad \text{DRs are } (3, -16, 7).
\]
The direction ratios (DRs) of the second line:
\[
\frac{x - 15}{3} = \frac{y - 29}{8} = \frac{z - 5}{-5} \quad \Rightarrow \quad \text{DRs are } (3, 8, -5).
\]
Step 3: Determine the direction ratios of the required line.
The required line is perpendicular to both given lines. If the DRs of the required line are \( (l, m, n) \), then:
\[
3l - 16m + 7n = 0 \quad \text{(perpendicular to the first line)}.
\]
\[
3l + 8m - 5n = 0 \quad \text{(perpendicular to the second line)}.
\]
Solve these two equations:
1. \( 3l - 16m + 7n = 0 \),
2. \( 3l + 8m - 5n = 0 \).
Subtract the equations:
\[
(3l - 16m + 7n) - (3l + 8m - 5n) = 0.
\]
Simplify:
\[
-24m + 12n = 0 \quad \Rightarrow \quad -2m + n = 0 \quad \Rightarrow \quad n = 2m.
\]
Substitute \( n = 2m \) into \( 3l - 16m + 7n = 0 \):
\[
3l - 16m + 7(2m) = 0 \quad \Rightarrow \quad 3l - 16m + 14m = 0 \quad \Rightarrow \quad 3l - 2m = 0.
\]
Solve for \( l \):
\[
l = \frac{2m}{3}.
\]
Thus, the DRs of the required line are proportional to:
\[
\left(\frac{2}{3}, 1, 2\right).
\]
Step 4: Write the equation of the line.
The required line passes through the midpoint \( P(3, 4, 6) \) and has direction ratios proportional to \( (2, 3, 6) \). Its equation is:
\[
\frac{x - 3}{2} = \frac{y - 4}{3} = \frac{z - 6}{6}.
\]
Conclusion:
The equation of the required line is:
\[
\boxed{\frac{x - 3}{2} = \frac{y - 4}{3} = \frac{z - 6}{6}}.
\]