Step 1: Find the value of 'a'.
The normal vectors to the two planes are \( \vec{n_1} = a\vec{i}-\vec{j}+3\vec{k} \) and \( \vec{n_2} = 3\vec{i}+a\vec{j}+\vec{k} \).
The angle \(\theta\) between the planes is the angle between their normal vectors, given by \( \cos\theta = \frac{|\vec{n_1} \cdot \vec{n_2}|}{|\vec{n_1}||\vec{n_2}|} \).
Given \( \theta = \pi/3 \), so \( \cos(\pi/3) = 1/2 \).
\( \vec{n_1} \cdot \vec{n_2} = (a)(3) + (-1)(a) + (3)(1) = 3a - a + 3 = 2a+3 \).
\( |\vec{n_1}| = \sqrt{a^2+(-1)^2+3^2} = \sqrt{a^2+10} \).
\( |\vec{n_2}| = \sqrt{3^2+a^2+1^2} = \sqrt{a^2+10} \).
So, \( \frac{1}{2} = \frac{|2a+3|}{(\sqrt{a^2+10})(\sqrt{a^2+10})} = \frac{|2a+3|}{a^2+10} \).
This gives \( a^2+10 = 2|2a+3| \).
Case 1: \(2a+3 \ge 0\). \( a^2+10 = 2(2a+3) = 4a+6 \implies a^2-4a+4=0 \implies (a-2)^2=0 \implies a=2 \). This is consistent with \(2a+3 \ge 0\).
Case 2: \(2a+3<0\). \( a^2+10 = -2(2a+3) = -4a-6 \implies a^2+4a+16=0 \). The discriminant is \(4^2 - 4(16)<0\), so no real solutions.
Thus, the only value is \(a=2\).
Step 2: Find the direction ratios of the line perpendicular to the third plane.
The third plane is \((a+2)x+(a-4)y+2az=a\). Substitute \(a=2\).
\((2+2)x+(2-4)y+2(2)z=2 \implies 4x - 2y + 4z = 2\).
The direction ratios of the normal to this plane are the coefficients of x, y, and z, which are (4, -2, 4).
A line perpendicular to this plane will have direction ratios parallel to the normal vector.
So the direction ratios of the line are proportional to (4, -2, 4).
We can simplify this by dividing by 2, which gives (2, -1, 2). This matches option (A).