linenumber=16
sed "${linenumber}s/$/sometext/" file
will append sometext to line 16 of file.
EDIT: If you want to edit the file inplace then check if your sed supports -i . If not then you'll need to redirect to a temp file and move/copy the files around.