It oughta work. Seems to work here with this test scenario. Similar to previous response, two likely causes would be "file is empty" or "grep didn't find anything".
$cat temp.sh
echo "Line 1" > lines.x
echo "Line 2" >> lines.x
x=`cat lines.x`
echo x = $x
y=$(cat lines.x)
echo y = $y
rm lines.x
$./temp.sh
x = Line 1 Line 2
y = Line 1 Line 2