Step 1: Formula for the angle between two lines.
The angle \( \theta \) between two lines with direction ratios \( (a_1, b_1, c_1) \) and \( (a_2, b_2, c_2) \) is given by:
\[
\cos \theta = \frac{a_1 a_2 + b_1 b_2 + c_1 c_2}{\sqrt{a_1^2 + b_1^2 + c_1^2} \sqrt{a_2^2 + b_2^2 + c_2^2}}
\]
We are given that \( \theta = \frac{\pi}{3} \), so \( \cos \frac{\pi}{3} = \frac{1}{2} \).
Step 2: Substituting the values.
The direction ratios of the lines are \( (4, -3, 5) \) and \( (3, 4, k) \). Substituting these into the formula:
\[
\frac{4 \cdot 3 + (-3) \cdot 4 + 5 \cdot k}{\sqrt{4^2 + (-3)^2 + 5^2} \sqrt{3^2 + 4^2 + k^2}} = \frac{1}{2}
\]
Simplifying the numerator and denominator:
\[
\frac{12 - 12 + 5k}{\sqrt{16 + 9 + 25} \sqrt{9 + 16 + k^2}} = \frac{1}{2}
\]
\[
\frac{5k}{\sqrt{50} \sqrt{25 + k^2}} = \frac{1}{2}
\]
Step 3: Solving for \( k \).
Cross-multiply and solve for \( k \):
\[
10k = \sqrt{50} \sqrt{25 + k^2}
\]
Squaring both sides:
\[
100k^2 = 50(25 + k^2)
\]
\[
100k^2 = 1250 + 50k^2
\]
\[
50k^2 = 1250
\]
\[
k^2 = 25
\]
Thus, \( k = \pm 5 \).
Step 4: Conclusion.
Thus, the value of \( k \) is \( \boxed{\pm 5} \).