UPDATE: Fault in processing code - doesn't receive correct data from Arduino
You're sending your lightval twice - once as a textual representation of the number, and once as a character representing the lower 8 bits:

Serial.println(lightval);
Serial.write(lightval);


For example:

Q308
R304
Q306


If you take the 308 and AND it with 255 you get 52.  52 as an ASCII character is R.

So you print 308, including a newline, then you print "R".  Then you print 304, which would be 48 after ANDing with 255 - which of course is a Q.